body {
    font-family: Georgia;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #eef2ff 0%, #eff6ff 60%, #f0fdf4 100%);
}

header {
    background-color: #3333CB;
    color: white;
    font-family: "Fustat", sans-serif;
    font-size: 20px;
    padding: 25px 15px;
    height: 15%;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card a {
    text-decoration: none;
    color: inherit;
    font-family: "Fustat", sans-serif;
}

header h2 {
    color: white;
    margin-left: 20px;
    margin: 0;
}

header a {
    text-decoration: none;
    color: inherit;
    font-family: "Unbounded", sans-serif;
}

header h5 {
    margin: 0;
}

.home-btn {
    padding: 10px 30px;
    border-radius: 50px;
    border: 2px solid white;
    background: transparent;
    color: white !important;
    font-weight: 600;
    font-family: "Fustat", sans-serif;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.4s ease;
    margin-right: 20px;
}

.home-btn:hover {
    background: white;
    color: #3333CB !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.card {
    background: white;
    position: relative;
    border-radius: 20px;
    border-top: 5px solid #3333CB;
    box-shadow: 0 8px 32px rgba(51, 51, 203, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 28px 24px 32px;
    margin: 50px auto;
    width: 90%;
    max-width: 420px;
    text-align: center;
    height: auto;
    min-height: 70%;
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3333CB, #6366f1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.card-icon i {
    font-size: 26px;
    color: white;
}

.tagline {
    font-family: "Fustat", sans-serif;
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 24px;
}

h2 {
    font-family: "Unbounded", sans-serif;
    font-weight: 600;
    font-size: 28px;
    letter-spacing: 0.5px;
    color: #1a1a2e;
    margin: 0 0 6px;
}

/* Input containers */
.input-container {
    position: relative;
    width: 84%;
    margin: 14px auto;
}

form input {
    width: 100%;
    box-sizing: border-box;
    height: 52px;
    padding: 20px 14px 6px 44px;
    border: 1.5px solid #d1d5db;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Fustat', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    color: #111827;
}

form input:focus {
    outline: none;
    border-color: #3333CB;
    box-shadow: 0 0 0 3px rgba(51, 51, 203, 0.12);
}

.input-container .field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
    pointer-events: none;
    transition: color 0.2s;
}

.input-container:focus-within .field-icon {
    color: #3333CB;
}

.input-container label {
    position: absolute;
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-family: 'Fustat', sans-serif;
    color: #9ca3af;
    pointer-events: none;
    transition: all 0.2s ease;
    background: white;
    padding: 0 3px;
}

form input:focus + label,
form input:not(:placeholder-shown) + label,
form input:-webkit-autofill + label {
    top: 10px;
    transform: none;
    font-size: 10px;
    color: #3333CB;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Password show/hide toggle */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: #3333CB;
}

.toggle-password i {
    font-size: 15px;
}

/* Buttons */
.submit {
    width: 84%;
    min-height: 48px;
    background: linear-gradient(-45deg, #3333CB 40%, #DBFFF9 50%, #3333CB 60%);
    background-size: 300%;
    background-position-x: 100%;
    animation-duration: 4s;
    animation-name: shimmer;
    animation-iteration-count: infinite;
    border: none;
    padding: 12px 10px;
    border-radius: 12px;
    cursor: pointer;
    color: white;
    font-family: "Fustat", sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 0;
    transition: box-shadow 0.2s;
}

.submit:hover {
    box-shadow: 0 6px 20px rgba(51, 51, 203, 0.35);
}

.reg {
    width: 84%;
    min-height: 48px;
    background: white;
    border: 2px solid #3333CB;
    padding: 12px 10px;
    border-radius: 12px;
    cursor: pointer;
    color: #3333CB;
    font-family: "Fustat", sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 14px;
    transition: background-color 0.2s;
}

.reg:hover {
    background-color: #f0f0ff;
}

@keyframes shimmer {
    to {
        background-position-x: -1%;
    }
}

#errorMessage {
    display: none;
    margin: 10px auto 0;
    width: 90%;
    padding: 10px 14px;
    border-radius: 8px;
    border-left: 3px solid #dc2626;
    background-color: rgba(220, 38, 38, 0.06);
    color: #991b1b;
    font-family: 'Fustat', sans-serif;
    font-size: 13px;
    text-align: left;
    animation: errorFadeIn 0.3s ease forwards;
}

@keyframes errorFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

#errorMessage.warning-state {
    border-left-color: #d97706;
    background-color: rgba(217, 119, 6, 0.06);
    color: #92400e;
}

.forgot-password {
    display: block;
    margin-top: 14px;
    font-size: 0.85em;
    color: #3333CB;
    text-decoration: none;
    cursor: pointer;
    font-family: "Fustat", sans-serif;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: #6366f1;
    text-decoration: underline;
}

.switch-version {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.switch-version a {
    font-family: "Fustat", sans-serif;
    font-size: 0.8em;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s;
}

.switch-version a:hover {
    color: #3333CB;
}

footer {
    text-align: center;
    font-family: "Unbounded";
    padding: 1rem;
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: auto;
}

footer a {
    color: #6b7280;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
    color: #3333CB;
}

/* Responsive */
@media (max-width: 992px) {
    .card {
        margin: 30px auto;
    }

    header {
        padding: 10px;
    }

    header h2 {
        margin-left: 10px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        flex-direction: column;
        text-align: center;
        padding: 15px 10px;
        gap: 10px;
    }

    header h2 {
        margin-left: 0;
        margin-bottom: 10px;
    }

    .home-btn {
        margin-right: 0;
        padding: 8px 24px;
        font-size: 13px;
    }

    .card {
        width: 90%;
        max-width: 400px;
        margin: 20px auto;
        padding: 24px 20px 28px;
    }

    h2 {
        font-size: 24px;
    }

    .input-container {
        width: 92%;
    }

    form input {
        font-size: 16px;
    }

    .submit, .reg {
        width: 92%;
        font-size: 16px;
    }

    .forgot-password {
        font-size: 0.9em;
        margin-top: 15px;
    }

    footer {
        flex-direction: column;
        gap: 20px;
        padding: 1.5rem 1rem;
        margin-top: 3rem;
    }
}

@media (max-width: 480px) {
    .card {
        width: 95%;
        margin: 15px auto;
        padding: 20px 15px 24px;
    }

    h2 {
        font-size: 22px;
    }

    .input-container {
        width: 96%;
    }

    .submit, .reg {
        width: 96%;
    }

    header {
        padding: 10px 5px;
    }
}
