/* Common Authentication Pages Styles */

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

/* Login page specific scroll lock — scoped to container */
.login-container {
    overflow: hidden;
}


.login-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.login-wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    background: white;
    overflow: hidden;
}

/* Left Side - Dark with tagline */
.login-left {
    flex: 1;
    background: #2b2b2b;
    background-image: url('https://images.unsplash.com/photo-1771200478895-ea7ddafdb254?q=80&w=764&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 3rem;
    color: white;
}

.login-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(43, 43, 43, 0.95) 0%, rgba(39, 55, 109, 0.85) 100%);
}

.left-content {
    position: relative;
    z-index: 1;
}

.tagline {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    font-weight: 400;
}

.left-title {
    font-size: 3.5rem;
    font-weight: 300;
    line-height: 1.2;
    margin-top: auto;
    padding-top: 8rem;
}

/* Right Side - White form */
.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    padding: 3rem;
    position: relative;
}

.brand-logo {
    position: absolute;
    top: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #27376d;
}

.signup-link {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s;
}

.signup-link:hover {
    color: #27376d;
}

.auth-card {
    max-width: 400px;
    width: 100%;
    margin-top: 2rem;
}

h2 {
    font-size: 2.5rem;
    font-weight: 400;
    color: #1a1a1a;
    margin-bottom: 2.5rem;
    text-align: left;
}

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group label {
    display: none;
}

.form-group input {
    border: none;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 0;
    padding: 1rem 0;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
    background: transparent;
}

.form-group input::placeholder {
    color: #999;
    font-weight: 400;
}

.form-group input:focus {
    border-bottom-color: #27376d;
    outline: none;
    box-shadow: none;
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #27376d;
}

.remember-me label {
    color: #666;
    font-size: 0.875rem;
    cursor: pointer;
    margin: 0;
    user-select: none;
}

.btn-auth {
    background: linear-gradient(135deg, #27376d 0%, #3d5a9e 100%);
    border: none;
    color: white;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-auth:hover {
    background: linear-gradient(135deg, #1e2850 0%, #27376d 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(39, 55, 109, 0.4);
    color: white;
}

.btn-auth:active {
    transform: translateY(0);
}

.btn-auth:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.alert {
    border-radius: 10px;
    border: none;
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
}

.footer-info {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    text-align: center;
    color: #999;
    font-size: 0.8rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-info a {
    color: #666;
    text-decoration: none;
}

.footer-info a:hover {
    color: #27376d;
}

.loading-spinner {
    display: none;
    text-align: center;
    padding: 0.75rem 0;
    color: #6b7280;
}

.spinner-border {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    display: inline-block;
    border-color: white;
    border-right-color: transparent;
}

/* Responsive Design */
@media (max-width: 968px) {
    .login-container {
        overflow: auto;
    }

    .login-wrapper {
        flex-direction: column;
        max-height: none;
        height: auto;
        min-height: 100vh;
    }

    .login-left {
        min-height: 180px;
        padding: 2rem;
    }

    .left-title {
        font-size: 2rem;
        padding-top: 2rem;
    }

    .login-right {
        padding: 2rem;
        overflow-y: auto;
        flex: 1;
    }

    .signup-link {
        position: static;
        margin-bottom: 2rem;
        justify-content: flex-end;
    }
}

/* Mobile: Hide left panel, show only the form */
@media (max-width: 768px) {
    .login-container {
        overflow: auto;
        height: auto;
        min-height: 100vh;
    }

    .login-wrapper {
        flex-direction: column;
        max-height: none;
        height: auto;
        min-height: 100vh;
    }

    /* Hide the left side image/tagline panel */
    .login-left {
        display: none !important;
    }

    /* Form side takes full space */
    .login-right {
        flex: 1;
        width: 100%;
        min-height: 100vh;
        padding: 1.5rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        overflow-y: auto;
    }

    /* Reposition brand logo for mobile */
    .brand-logo {
        position: relative;
        top: auto;
        left: auto;
        justify-content: center;
        margin-bottom: 1.5rem;
    }

    .brand-logo img {
        width: 40px;
        height: 40px;
    }

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

    /* Reposition signup/signin link for mobile */
    .signup-link {
        position: relative;
        top: auto;
        right: auto;
        justify-content: center;
        margin-bottom: 1rem;
    }

    .auth-card {
        max-width: 100%;
        width: 100%;
        margin-top: 0;
    }

    h2 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
        text-align: center;
    }

    .btn-auth {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .footer-info {
        position: relative;
        bottom: auto;
        margin-top: 2rem;
        padding-bottom: 1rem;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .login-container {
        padding: 0;
    }

    .login-wrapper {
        border-radius: 0;
    }

    .login-right {
        padding: 1.25rem;
    }

    h2 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }

    .form-group input {
        padding: 0.75rem 0;
        font-size: 0.9rem;
    }

    .brand-logo img {
        width: 36px;
        height: 36px;
    }

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

    .btn-auth {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .alert-info {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
}

/* =============================================
   Signup Page Styles
   ============================================= */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.role-selection {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.role-option {
    flex: 1;
    position: relative;
}

.role-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.role-option label {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    color: #666;
    font-weight: 500;
}

.role-option input[type="radio"]:checked+label {
    border-color: #27376d;
    background: rgba(39, 55, 109, 0.05);
    color: #27376d;
}

.role-option label:hover {
    border-color: #27376d;
}

#organizationSiteGroup {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-wrapper {
    position: relative;
}

.validation-icon {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    display: inline-block;
    line-height: 1;
}

.validation-icon i {
    font-size: 1.1rem;
}

.validation-icon i.success,
i.success {
    color: #10b981 !important;
}

.validation-icon i.error,
i.error {
    color: #ef4444 !important;
}

.field-error {
    display: none;
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.field-error.show {
    display: block;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-row .form-group {
        margin-bottom: 1.25rem;
    }

    .role-selection {
        flex-direction: column;
    }

    .role-option label {
        padding: 0.75rem 0.875rem;
        font-size: 0.9rem;
    }

    /* Signup page needs to scroll on mobile due to many fields */
    .login-right {
        justify-content: flex-start;
        padding-top: 2rem;
        min-height: auto;
    }
}

@media (max-width: 480px) {
    .form-row {
        gap: 0;
    }

    .role-option label {
        padding: 0.625rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* =============================================
   Update Password Page Styles
   ============================================= */

.password-requirements {
    font-size: 0.75rem;
    color: #666;
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #ff6b35;
}

.password-requirements strong {
    color: #333;
    display: block;
    margin-bottom: 0.5rem;
}

.password-requirements ul {
    margin: 0;
    padding-left: 1.25rem;
}

.password-requirements li {
    margin: 0.25rem 0;
}

.alert-info {
    background-color: #e7f3ff;
    color: #004085;
    border-left: 4px solid #27376d;
    border-radius: 8px;
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .password-requirements {
        font-size: 0.7rem;
        padding: 0.5rem;
    }
}