/*============================================
   Auth Pages Styles - TH Law Firm
   Matching Main Theme Design
==============================================*/

/* Auth Container & Layout */
.auth-container {
    min-height: 100vh;
    background: linear-gradient(
        135deg,
        var(--tg-theme-primary) 0%,
        var(--tg-heading-color) 100%
    );
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("../images/bg/team-bg-shape3-1.png") repeat;
    opacity: 0.1;
    z-index: 1;
}

.auth-content {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--tg-color-white-default);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    position: relative;
}

.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(
        90deg,
        var(--tg-theme-primary) 0%,
        var(--tg-color-dark-theme) 100%
    );
}

.auth-card-body {
    padding: 3rem 2.5rem 2.5rem;
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-header .auth-title {
    font-family: var(--tg-heading-font-family);
    font-size: 2rem;
    font-weight: 700;
    color: var(--tg-heading-color);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.auth-header .auth-subtitle {
    color: var(--tg-body-color);
    font-size: 1rem;
    margin-bottom: 0;
    line-height: 1.5;
}

/* Brand Logo */
.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand .brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--tg-heading-color);
    font-family: var(--tg-heading-font-family);
    font-size: 1.5rem;
    font-weight: 700;
}

.auth-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: var(--tg-theme-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

/* Form Styles */
.auth-form .form-floating {
    position: relative;
    margin-bottom: 1.5rem;
}

.auth-form .form-control {
    border: 2px solid var(--tg-border-1);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-family: var(--tg-body-font-family);
    transition: all 0.3s ease;
    background: var(--tg-color-white-default);
    min-height: 60px;
}

.auth-form .form-control:focus {
    border-color: var(--tg-theme-primary);
    box-shadow: 0 0 0 0.2rem rgba(18, 137, 130, 0.15);
    outline: none;
}

.auth-form .form-control.is-invalid {
    border-color: var(--tg-color-red-default);
}

.auth-form .form-floating label {
    color: var(--tg-body-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

/* RTL and LTR positioning for floating labels */
[dir="ltr"] .auth-form .form-floating label {
    padding-left: 1.25rem;
}

[dir="rtl"] .auth-form .form-floating label {
    padding-right: 1.25rem;
}

.auth-form .form-floating > .form-control:focus ~ label,
.auth-form .form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--tg-theme-primary);
}

/* RTL and LTR positioning for focused/filled floating labels */
[dir="ltr"] .auth-form .form-floating > .form-control:focus ~ label,
[dir="ltr"] .auth-form .form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

[dir="rtl"] .auth-form .form-floating > .form-control:focus ~ label,
[dir="rtl"] .auth-form .form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.85) translateY(-0.5rem) translateX(-0.15rem);
}

/* RTL support for form controls with password toggle */
[dir="ltr"] .form-floating.position-relative .form-control {
    padding-right: 3.5rem;
}

[dir="rtl"] .form-floating.position-relative .form-control {
    padding-left: 3.5rem;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--tg-body-color);
    cursor: pointer;
    z-index: 5;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

/* RTL and LTR positioning for password toggle */
[dir="ltr"] .password-toggle {
    right: 1rem;
    left: auto;
}

[dir="rtl"] .password-toggle {
    left: 1rem;
    right: auto;
}

.password-toggle:hover {
    color: var(--tg-theme-primary);
    background: rgba(18, 137, 130, 0.1);
}

/* Auth Button */
.auth-btn {
    width: 100%;
    background: var(--tg-theme-primary);
    border: none;
    border-radius: 12px;
    color: var(--tg-color-white-default);
    font-family: var(--tg-heading-font-family);
    font-size: 1rem;
    font-weight: 600;
    padding: 1rem 2rem;
    min-height: 60px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: capitalize;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.auth-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--tg-heading-color);
    border-radius: 50%;
    transition: all 0.4s ease;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.auth-btn:hover::before {
    width: 300px;
    height: 300px;
}

.auth-btn:hover {
    color: var(--tg-color-white-default);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(18, 137, 130, 0.3);
}

.auth-btn .btn-text {
    position: relative;
    z-index: 2;
}

.auth-btn .btn-icon {
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.auth-btn:hover .btn-icon {
    transform: translateX(3px);
}

/* Google Button */
.auth-btn-google {
    background: #ffffff;
    color: #757575;
    border: 2px solid #dadce0;
    margin-bottom: 1.5rem;
}

.auth-btn-google::before {
    background: #f8f9fa;
}

.auth-btn-google:hover {
    color: #3c4043;
    border-color: #d2e3fc;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    transform: translateY(-1px);
}

.auth-btn-google .btn-icon {
    background: linear-gradient(45deg, #4285f4, #34a853, #fbbc05, #ea4335);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.1rem;
}

.auth-btn-google:hover .btn-icon {
    transform: scale(1.05);
}

/* Social Divider */
.social-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    gap: 1rem;
}

.social-divider::before,
.social-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--tg-border-1);
}

.social-divider span {
    color: var(--tg-body-color);
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Form Check */
.auth-form .form-check {
    margin-bottom: 1.5rem;
}

.auth-form .form-check-input {
    border: 2px solid var(--tg-border-1);
    border-radius: 4px;
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0.2rem;
}

.auth-form .form-check-input:checked {
    background-color: var(--tg-theme-primary);
    border-color: var(--tg-theme-primary);
}

.auth-form .form-check-input:focus {
    border-color: var(--tg-theme-primary);
    box-shadow: 0 0 0 0.2rem rgba(18, 137, 130, 0.15);
}

.auth-form .form-check-label {
    color: var(--tg-body-color);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-left: 0.5rem;
}

/* Auth Links */
.auth-link {
    color: var(--tg-theme-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.auth-link::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--tg-theme-primary);
    transition: width 0.3s ease;
}

.auth-link:hover {
    color: var(--tg-heading-color);
}

.auth-link:hover::after {
    width: 100%;
}

/* Divider */
.auth-divider {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--tg-border-1);
}

.auth-divider span {
    background: var(--tg-color-white-default);
    color: var(--tg-body-color);
    padding: 0 1rem;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* Alert Styles */
.auth-alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.auth-alert.alert-danger {
    background: rgba(237, 23, 48, 0.1);
    color: var(--tg-color-red-default);
    border-left: 4px solid var(--tg-color-red-default);
}

.auth-alert .alert-icon {
    margin-right: 0.5rem;
}

.auth-alert ul {
    margin-bottom: 0;
    padding-left: 1.5rem;
}

/* Remember Me & Forgot Password */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Back to Login/Register */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--tg-border-1);
}

.auth-footer .auth-footer-text {
    color: var(--tg-body-color);
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        background: linear-gradient(
            180deg,
            var(--tg-theme-primary) 0%,
            var(--tg-heading-color) 100%
        );
    }

    .auth-content {
        padding: 1.5rem;
        align-items: flex-start;
        padding-top: 3rem;
    }

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

    .auth-card-body {
        padding: 2.5rem 2rem;
    }

    .auth-header .auth-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 576px) {
    .auth-content {
        padding: 1rem;
        padding-top: 2rem;
    }

    .auth-card-body {
        padding: 2rem 1.5rem;
    }

    .auth-header .auth-title {
        font-size: 1.5rem;
    }

    .auth-options {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .form-floating .form-control {
        min-height: 55px;
        padding: 0.875rem 1rem;
    }

    .auth-btn,
    .auth-btn-google {
        min-height: 55px;
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 375px) {
    .auth-card-body {
        padding: 1.5rem 1rem;
    }

    .auth-header .auth-title {
        font-size: 1.35rem;
    }

    .auth-header .auth-subtitle {
        font-size: 0.9rem;
    }

    .auth-brand .brand-logo {
        font-size: 1.35rem;
    }

    .auth-brand .brand-icon {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }
}

/* Landscape mobile optimization */
@media (max-height: 600px) and (orientation: landscape) {
    .auth-content {
        align-items: flex-start;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .auth-header {
        margin-bottom: 1.5rem;
    }

    .auth-brand {
        margin-bottom: 1rem;
    }

    .form-floating {
        margin-bottom: 1rem;
    }

    .social-divider {
        margin: 1rem 0;
    }

    .auth-divider {
        margin: 1rem 0;
    }
} /* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading State */
.auth-btn.loading {
    pointer-events: none;
}

.auth-btn.loading .btn-text {
    opacity: 0.7;
}

.auth-btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 3;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
