/* ============================================
   CREWIO LOGIN - Modern Clean Design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&display=swap');

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

:root {
    --bg: #f0f2f5;
    --dark: #1a1c23;
    --dark-btn: #263450;
    --dark-lighter: #252830;
    --accent: #4f83ea;
    --accent-dark: #3b6fd6;
    --accent-glow: rgba(79, 131, 234, 0.25);
    --card: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --text-light: rgba(255, 255, 255, 0.7);
    --border: #e5e7eb;
    --input-bg: #f9fafb;
    --error: #ef4444;
    --error-bg: #fef2f2;
    --success: #10b981;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   BACKGROUND PATTERN
   ============================================ */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(79, 131, 234, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 111, 214, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 60% 80%, rgba(79, 131, 234, 0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   CONTAINER
   ============================================ */
.container {
    width: 100%;
    max-width: 960px;
    position: relative;
    z-index: 1;
}

/* ============================================
   LOGIN CARD
   ============================================ */
.login-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

@media (min-width: 768px) {
    .login-card {
        flex-direction: row;
        min-height: 540px;
    }
}

/* ============================================
   BRAND PANEL (Left)
   ============================================ */
.brand-panel {
    background: var(--dark);
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .brand-panel {
        width: 42%;
        padding: 3.5rem 2.5rem;
    }
}

/* Subtle grid pattern */
.brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: 32px 32px;
    pointer-events: none;
}

/* Glow accent */
.brand-panel::after {
    content: '';
    position: absolute;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    bottom: -60px;
    left: -40px;
    pointer-events: none;
}

/* Decorative elements */
.decoration {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.decoration-1 {
    width: 200px;
    height: 200px;
    bottom: -80px;
    right: -60px;
    border: 1px solid rgba(79, 131, 234, 0.15);
}

.decoration-2 {
    width: 120px;
    height: 120px;
    top: -30px;
    left: -30px;
    border: 1px solid rgba(79, 131, 234, 0.1);
}

/* Logo */
.logo-square {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    background: #fff;
    display: grid;
    place-items: center;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.logo-square:hover {
    transform: translateY(-2px);
}

.logo-img {
    width: 80%;
    height: auto;
    display: block;
}

/* Brand Name */
.brand-name {
    position: relative;
    z-index: 2;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.brand-name-io {
    color: var(--accent);
}

/* Tagline */
.brand-tagline {
    position: relative;
    z-index: 2;
    font-size: 0.875rem;
    color: var(--text-light);
    text-align: center;
    line-height: 1.5;
    max-width: 220px;
}

/* ============================================
   FORM PANEL (Right)
   ============================================ */
.form-panel {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (min-width: 768px) {
    .form-panel {
        width: 58%;
        padding: 3rem 3.5rem;
    }
}

/* Welcome text */
.form-welcome {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.375rem;
}

.form-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.375rem;
    letter-spacing: -0.02em;
}

.form-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* ============================================
   FORM
   ============================================ */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Error Messages */
.message-error {
    padding: 0.75rem 1rem;
    background: var(--error-bg);
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 0.8125rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-error::before {
    content: '!';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    background: var(--error);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
}

.message-info {
    padding: 0.75rem 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    color: #1e40af;
    font-size: 0.8125rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-info::before {
    content: 'i';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    font-style: italic;
}

.message-success {
    padding: 0.75rem 1rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-sm);
    color: #065f46;
    font-size: 0.8125rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-success::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
}

.form-error {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--error);
    font-weight: 500;
}

/* Input Groups */
.input-group {
    display: flex;
    flex-direction: column;
}

.input-wrapper {
    position: relative;
}

.input-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.input-group input {
    width: 100%;
    height: 3rem;
    padding: 0 2.75rem 0 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text);
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.input-group input::placeholder {
    color: #9ca3af;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: #fff;
}

.input-group input.is-invalid {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.input-icon {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    transition: color 0.2s;
}

.input-wrapper:focus-within .input-icon {
    color: var(--accent);
}

/* ============================================
   FORGOT PASSWORD
   ============================================ */
.forgot-password {
    text-align: right;
    margin-top: -0.5rem;
}

.forgot-password a {
    font-size: 0.8125rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-password a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */
.submit-btn {
    width: 100%;
    height: 3rem;
    padding: 0 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: var(--dark-btn);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}

.submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.25s;
}

.submit-btn:hover {
    background: var(--dark-lighter);
    box-shadow: 0 6px 20px -4px rgba(26, 28, 35, 0.4);
    transform: translateY(-1px);
}

.submit-btn:hover::before {
    opacity: 1;
}

.submit-btn:active {
    transform: translateY(0) scale(0.985);
    box-shadow: 0 2px 8px -2px rgba(26, 28, 35, 0.3);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2.5rem;
    letter-spacing: 0.01em;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
    .brand-panel {
        padding: 2.5rem 2rem;
        gap: 1rem;
    }

    .logo-square {
        width: 64px;
        height: 64px;
        border-radius: 14px;
    }

    .brand-name {
        font-size: 1.625rem;
    }

    .brand-tagline {
        font-size: 0.8125rem;
    }

    .form-panel {
        padding: 2rem 1.5rem;
    }

    .form-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 380px) {
    body {
        padding: 0;
    }

    .login-card {
        border-radius: 0;
        min-height: 100dvh;
        box-shadow: none;
        border: none;
    }

    .brand-panel {
        padding: 2rem 1.5rem;
        border-radius: 0;
    }

    .form-panel {
        padding: 1.75rem 1.25rem;
        flex: 1;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    animation: fadeUp 0.5s ease-out;
}

.login-form > * {
    animation: fadeUp 0.4s ease-out both;
}

.login-form > :nth-child(1) { animation-delay: 0.04s; }
.login-form > :nth-child(2) { animation-delay: 0.08s; }
.login-form > :nth-child(3) { animation-delay: 0.12s; }
.login-form > :nth-child(4) { animation-delay: 0.16s; }
.login-form > :nth-child(5) { animation-delay: 0.20s; }
.login-form > :nth-child(6) { animation-delay: 0.24s; }

/* Focus ring animation */
@keyframes focusPulse {
    0% { box-shadow: 0 0 0 0px var(--accent-glow); }
    100% { box-shadow: 0 0 0 3px var(--accent-glow); }
}

.input-group input:focus {
    animation: focusPulse 0.2s ease-out forwards;
}

/* ============================================
   PASSWORD RESET PAGES
   ============================================ */

/* Icon Circle */
.reset-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #eef2ff 0%, #dbeafe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.reset-icon-circle.reset-icon-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: var(--success);
}

.reset-icon-circle.reset-icon-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    color: var(--error);
}

.reset-icon-circle.reset-icon-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #d97706;
}

/* Info Box */
.info-box {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: #1e40af;
    margin-top: 0.25rem;
}

.info-box svg {
    flex-shrink: 0;
}

.info-box.info-box-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

/* Back to login */
.back-to-login {
    text-align: center;
    margin-top: 2rem;
}

.back-to-login a {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.back-to-login a:hover {
    color: var(--accent);
}

/* Password Rules */
.password-rules {
    padding: 0.875rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: -0.25rem;
}

.password-rules p {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.password-rules ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-rules li {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.125rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.password-rules li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
}