/* =============================================================================
   login.css – Modern, Classic-Inspired Styles for Alumni Portal Login/Signup
   -----------------------------------------------------------------------------
   This stylesheet creates a visually appealing, user-friendly login/signup page
   for the alumni portal. It uses a fixed gradient background with floating shapes
   for a modern-classic look, glassmorphism for the form, and smooth transitions.
   The scroll-to-top button is styled to match and only appears when needed.
   Custom scrollbars and responsive design ensure a polished experience on all devices.

   Why needed:
     - Makes authentication pages inviting and easy to use.
     - Keeps the form centered and readable above a fixed, decorative background.
     - Enhances usability with clear focus states, feedback, and a floating scroll button.

   How it works:
     - The background gradient and shapes are fixed and never scroll.
     - The form floats above with a glass effect and shadow.
     - All UI elements use CSS variables for easy theming.
     - The scroll-to-top button is hidden by default and appears on scroll.
     - Responsive rules ensure the layout adapts to all screen sizes.
   =============================================================================
*/

/* -------------------------------
   1. Theme Variables & Resets
---------------------------------*/
:root {
    --primary-color: #667eea;
    --primary-dark: #5a6fd8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --border-radius: 14px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    scroll-behavior: smooth;
}

/* -------------------------------
   2. Fixed Gradient Background & Shapes
---------------------------------*/
body {
    font-family: 'Poppins', sans-serif;
    background: var(--gradient-primary) fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* Floating, blurred shapes for a modern-classic effect */
.bg-shapes {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.12);
    animation: float 7s ease-in-out infinite;
    filter: blur(0.5px);
}
.shape-1 {
    width: 110px; height: 110px;
    top: 8%; left: 8%;
    background: linear-gradient(135deg, #f093fb 0%, #667eea 100%);
    animation-delay: 0s;
}
.shape-2 {
    width: 170px; height: 170px;
    top: 65%; right: 8%;
    background: linear-gradient(135deg, #764ba2 0%, #f5576c 100%);
    animation-delay: 2s;
}
.shape-3 {
    width: 80px; height: 80px;
    bottom: 18%; left: 22%;
    background: linear-gradient(135deg, #f093fb 0%, #764ba2 100%);
    animation-delay: 4s;
}
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-24px) rotate(180deg); }
}

/* -------------------------------
   3. Centered Glassmorphism Form
---------------------------------*/
.container {
    width: 100%;
    max-width: 440px;
    margin: 32px 0;
    position: relative;
    z-index: 2;
}

/* Glass effect, shadow, and smooth transitions for the form */
.form-container {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px) saturate(120%);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
    padding: 44px 36px 36px 36px;
    position: absolute;
    width: 100%;
    transform: translateX(100%);
    opacity: 0;
    transition: var(--transition);
}
.form-container.active {
    transform: translateX(0);
    opacity: 1;
    position: relative;
    z-index: 3;
}

/* -------------------------------
   4. Form Header & Layout
---------------------------------*/
.form-header {
    text-align: center;
    margin-bottom: 28px;
}
.form-header h2 {
    color: var(--text-primary);
    font-size: 2.1rem;
    font-weight: 700;
    margin-bottom: 7px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.form-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}
.form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.input-group {
    display: flex;
    flex-direction: column;
}

/* -------------------------------
   5. Input Fields & Icons
---------------------------------*/
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-wrapper i {
    position: absolute;
    left: 15px;
    color: var(--text-secondary);
    font-size: 1rem;
    z-index: 2;
    transition: var(--transition);
}
.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-white);
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}
.input-wrapper input:focus,
.input-wrapper select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.13);
    transform: translateY(-2px);
}
.input-wrapper input:focus + i,
.input-wrapper select:focus + i {
    color: var(--primary-color);
}
.input-wrapper select:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Password show/hide toggle icon */
.toggle-password {
    right: 15px !important;
    left: auto !important;
    cursor: pointer;
    color: var(--text-secondary) !important;
    font-size: 1.1rem;
}
.toggle-password:hover {
    color: var(--primary-color) !important;
}

/* -------------------------------
   6. Checkbox, Options, and Links
---------------------------------*/
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
}
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    position: relative;
}
.checkbox-container input {
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.checkmark {
    height: 18px;
    width: 18px;
    background-color: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: var(--transition);
}
.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary-color);
}
.checkbox-container input:checked ~ .checkmark {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
}
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}
.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}
.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* -------------------------------
   7. Buttons
---------------------------------*/
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-medium);
}
.btn-primary:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: var(--shadow-heavy);
}
.btn-primary:active {
    transform: translateY(0) scale(1);
}

/* -------------------------------
   8. Form Footer & Links
---------------------------------*/
.form-footer {
    text-align: center;
    margin-top: 20px;
}
.form-footer p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}
.form-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* -------------------------------
   9. Message Container (Feedback)
---------------------------------*/
.message-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    transform: translateX(120%);
    transition: var(--transition);
}
.message-container.show {
    transform: translateX(0);
}
.message {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    box-shadow: var(--shadow-medium);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    border-left: 4px solid var(--primary-color);
}
.message.success {
    border-left-color: #48bb78;
}
.message.success i {
    color: #48bb78;
}
.message.error {
    border-left-color: #f56565;
}
.message.error i {
    color: #f56565;
}
.message span {
    font-size: 0.98rem;
    color: var(--text-primary);
}

/* -------------------------------
   10. Modern Scroll-to-Top Button
---------------------------------*/
.scroll-top-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.85;
    z-index: 1200;
    transition: background 0.2s, opacity 0.2s;
    display: none; /* Hidden by default, shown via JS */
}
.scroll-top-btn:hover {
    background: var(--gradient-secondary);
    opacity: 1;
}

/* -------------------------------
   11. Responsive Design
---------------------------------*/
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        margin: 10px;
    }
    .form-container {
        padding: 30px 14px;
    }
    .form-header h2 {
        font-size: 1.7rem;
    }
    .input-row {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .form-options {
        flex-direction: column;
        gap: 13px;
        align-items: flex-start;
    }
    .message-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    .message {
        min-width: auto;
        width: 100%;
    }
    .scroll-top-btn {
        bottom: 18px;
        right: 18px;
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }
}
@media (max-width: 480px) {
    .form-container {
        padding: 18px 6px;
    }
    .form-header h2 {
        font-size: 1.2rem;
    }
    .input-wrapper input,
    .input-wrapper select {
        padding: 11px 11px 11px 38px;
        font-size: 0.92rem;
    }
    .btn {
        padding: 11px 18px;
        font-size: 0.92rem;
    }
}

/* -------------------------------
   12. Button Loading Animation
---------------------------------*/
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}
.btn.loading::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* -------------------------------
   13. Custom Scrollbar Styling
---------------------------------*/
::-webkit-scrollbar {
    width: 7px;
}
::-webkit-scrollbar-track {
    background: var(--bg-light);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* For Firefox */
body, .form-container {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-light);
}