/* --- Global Styles & Variables --- */
:root {
    --primary-color: #3478A8;
    --active-color: #2C5F85;
    --border-color: #BFD6E5;
    --light-bg: #EBF5FB;
    --text-color: #333;
    --light-text-color: #777;
    --white: #FFFFFF;
    --danger-color: #FF4949;
    --font-family: 'Poppins', sans-serif;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

/* --- Body Layout --- */
body {
    font-family: var(--font-family);
    background-color: var(--light-bg);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

/* --- Logo --- */
.brand-logo {
    text-align: center;
    margin-bottom: 0.5rem;
}

.brand-logo img {
    max-width: 150px;
    height: auto;
}

/* --- Form Layout --- */
.form-container {
    width: 100%;
    min-width: 450px;
    max-width: 475px;
    background-color: var(--white);
    border-radius: 16px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.form {
    padding: 1.5rem 2rem;
}

.form h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    text-align: center;
}

.form .subtitle {
    color: var(--light-text-color);
    text-align: center;
    margin-bottom: 2rem;
}

/* --- Form Controls --- */
.control {
    margin-bottom: 1.25rem;
    position: relative;
}

.label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 120, 168, 0.2);
}

/* --- Options & Links --- */
.options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.options a,
.signup-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.options a:hover,
.signup-link a:hover {
    text-decoration: underline;
}

.signup-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

/* --- Submit Button --- */
.submit .button {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.15s ease;
}

.submit .button:hover {
    background-color: var(--active-color);
    transform: translateY(-1px);
}

.submit .button:active {
    transform: translateY(0);
}

/* --- Password Toggle Icon --- */
.sc-ui-pwd-toggle-icon {
    position: absolute;
    top: 70%;
    right: 12px;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 10;
    color: var(--light-text-color);
    transition: color 0.2s ease;
}

.sc-ui-pwd-toggle-icon:hover {
    color: var(--primary-color);
}

/* --- Scriptcase Error Message --- */
.alert-message {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--danger-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 320px;
    text-align: center;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease;
}

.alert-message.active {
    display: block;
    transform: translate(-50%, 0);
    opacity: 1;
}

.alert-message .close {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

/* --- Responsive Tweaks --- */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .form-container {
        max-width: 100%;
        min-width: 320px;
        margin: 0 auto;
        border-radius: 12px;
    }

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

@media (max-width: 480px) {
    body {
        padding: 0.6rem;
    }

    .form-container {
        max-width: 100%;
        min-width: 280px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .form {
        padding: 1.75rem 1.25rem;
    }

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

    .brand-logo img {
        max-width: 120px;
    }

    .input {
        padding: 10px 12px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .submit .button {
        padding: 12px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }
}