@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #306EE8;
    --primary-hover: #2658ba;
    --bg-gradient: linear-gradient(140deg, #306ee8 0%, #3038e8 100%);
    --white: #ffffff;
    --text-main: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --card-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    --input-focus-shadow: 0 0 0 0.25rem rgba(48, 110, 232, 0.25);
}

* {
    box-sizing: border-box;
}

body,
html {
    margin: 0;
    padding: 0;
    font-family: 'Work Sans', sans-serif;
    min-height: 100vh;
}

.login-background {
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Back to center, with auto margin handling overflow */
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 30px 20px;
}

.login-background .blob {
    position: absolute;
    right: -20%;
    top: 50%;
    transform: translateY(-50%);
    width: 900px;
    z-index: 0;
    opacity: 0.6;
    pointer-events: none;
}

.auth-container {
    width: 100%;
    max-width: 480px;
    z-index: 10;
    position: relative;
    margin: auto;
    /* Handles centering more robustly with flex-start parent */
}

.auth-card {
    background: var(--white);
    padding: 2rem;
    /* Reduced from 2.5rem */
    border-radius: 1.25rem;
    box-shadow: var(--card-shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
    /* Reduced from 2rem */
}

.auth-logo {
    max-height: 45px;
    /* Slightly smaller logo */
    margin-bottom: 1.25rem;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.auth-subtitle {
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1rem;
    /* Slightly tighter for taller forms like register */
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-main);
    font-size: 0.9rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem;
    /* Compact padding */
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-main);
    background-color: #f8f9fa;
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: var(--text-main);
    background-color: var(--white);
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: var(--input-focus-shadow);
}

.btn-auth {
    display: block;
    width: 100%;
    padding: 0.875rem 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    user-select: none;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: var(--white);
    border-radius: 0.75rem;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    margin-top: 1rem;
}

.btn-auth:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(48, 110, 232, 0.3);
}

.auth-footer {
    margin-top: 1rem;
    /* Reduced from 1.5rem */
    text-align: center;
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.auth-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.help-block.text-danger {
    font-size: 0.85rem;
    margin-top: 0.25rem;
    color: #dc3545;
}

/* Mobile Adjustments (30% reduction) */
@media (max-width: 576px) {
    .auth-card {
        padding: 1.25rem;
    }

    .auth-logo {
        max-height: 35px;
    }

    .auth-title {
        font-size: 1.2rem;
    }

    .auth-subtitle {
        font-size: 0.75rem;
    }

    .form-group {
        margin-bottom: 0.75rem;
    }

    .form-label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }

    .form-control {
        padding: 0.45rem 0.75rem;
        font-size: 0.8rem;
    }

    .btn-auth {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        margin-top: 0.75rem;
    }

    .auth-footer {
        margin-top: 0.75rem;
    }

    .auth-link {
        font-size: 0.75rem;
    }
}