/* ==================== MODERN SIGN IN PAGE STYLES ==================== */

:root {
    --auth-bg: #fafafa;
    --auth-border: #e0e0e0;
    --auth-text: #262626;
    --auth-text-light: #737373;
    --auth-text-lighter: #999;
    --auth-accent: #0ea5e9;
    --auth-accent-dark: #0284c7;
    --auth-white: #ffffff;
    --auth-error: #dc2626;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background-color: var(--auth-bg);
    color: var(--auth-text);
    line-height: 1.5;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Back Button */
.auth-back-button {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 100;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--auth-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--auth-bg);
    color: var(--auth-text);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.back-btn:hover {
    background: var(--auth-border);
}

.back-btn i {
    font-size: 1rem;
}

/* Main Auth Container */
.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 100vh;
    max-width: 100%;
    flex: 1;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Visual Panel */
.auth-visual-panel {
    background-image: url('../assets/images/sign_in_background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    border-right: 1px solid var(--auth-border);
    position: relative;
    overflow: hidden;
}

.auth-visual-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.45) 100%);
    pointer-events: none;
}

.visual-content {
    text-align: center;
    max-width: 400px;
    width: 100%;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.brand-logo {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    margin: 0 auto 1.5rem;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.brand-name {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.brand-logo-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 1.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
    background-color: #ffffff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.brand-tagline {
    font-size: 0.95rem;
    color: #ffffff;
    margin-bottom: 3rem;
    font-weight: 600;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: left;
}

.feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
    color: #ffffff;
}

.feature-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-accent);
    color: var(--auth-white);
    border-radius: 8px;
    flex-shrink: 0;
    font-size: 1.1rem;
}

/* Form Panel */
.auth-form-panel {
    background: var(--auth-white);
}

.auth-form-container {
    width: 100%;
    max-width: 380px;
}

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

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--auth-text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.3px;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--auth-text-light);
    font-weight: 400;
}

/* Alert Messages */
.auth-alert {
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease;
}

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

.alert-error {
    background: #fee2e2;
    color: var(--auth-error);
    border: 1px solid #fecaca;
}

.auth-alert i {
    flex-shrink: 0;
    font-size: 1rem;
    margin-top: 2px;
}

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--auth-white);
    color: var(--auth-text);
    transition: all 0.2s ease;
}

.form-control::placeholder {
    color: var(--auth-text-lighter);
}

.form-control:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-control.error {
    border-color: var(--auth-error);
    background: #fef2f2;
}

/* Password Field */
.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.show-password-btn {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--auth-text-lighter);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    z-index: 3;
}

.show-password-btn:hover {
    color: var(--auth-accent);
}

/* Field Error */
.field-error {
    font-size: 0.8rem;
    color: var(--auth-error);
    display: none;
    margin-top: 0.2rem;
}

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

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-input {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--auth-accent);
    min-width: 14px;
    min-height: 14px;
}

.checkbox-label {
    color: var(--auth-text-light);
    font-weight: 500;
}

.forgot-link {
    color: var(--auth-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: var(--auth-accent-dark);
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    background: var(--auth-accent);
    color: var(--auth-white);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.auth-submit-btn:hover {
    background: var(--auth-accent-dark);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.auth-submit-btn:active {
    transform: scale(0.98);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--auth-text-lighter);
    font-size: 0.9rem;
}

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

/* Social Login */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    background: var(--auth-white);
    color: var(--auth-text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.social-btn:hover {
    border-color: var(--auth-text-light);
    background: var(--auth-bg);
}

.google-btn:hover {
    border-color: #4285f4;
    background: #f8f9ff;
}

.social-btn i {
    font-size: 1.1rem;
}

/* Form Footer */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--auth-text-light);
}

.footer-text {
    margin: 0;
}

.footer-link {
    color: var(--auth-accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--auth-accent-dark);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--auth-white);
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: modalSlideUp 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--auth-bg);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-text);
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.modal-close:hover {
    background: var(--auth-border);
    transform: rotate(90deg);
}

.modal-content {
    text-align: center;
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-icon {
    color: var(--auth-error);
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--auth-text);
    margin-bottom: 0.5rem;
}

.modal-description {
    font-size: 0.95rem;
    color: var(--auth-text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.modal-info {
    font-size: 0.85rem;
    color: var(--auth-text-lighter);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-action-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    background: var(--auth-accent);
    color: var(--auth-white);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-action-btn:hover {
    background: var(--auth-accent-dark);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1999;
    display: none;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--auth-border);
    border-top-color: var(--auth-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .auth-container {
        grid-template-columns: 1fr;
    }

    .auth-visual-panel {
        display: none;
    }

    .auth-form-panel {
        align-items: flex-start;
        padding-top: 4rem;
    }
}

@media (max-width: 768px) {
    .auth-back-button {
        padding: 0.75rem 1rem;
    }

    .auth-form-panel {
        padding: 1.5rem;
    }

    .auth-form-container {
        max-width: 100%;
    }

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

    .brand-logo {
        width: 60px;
        height: 60px;
    }

    .form-control {
        font-size: 16px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .modal-box {
        padding: 1.5rem;
        max-width: calc(100% - 2rem);
    }
}

@media (max-width: 480px) {
    .auth-back-button {
        padding: 0.5rem 1rem;
    }

    .auth-form-panel {
        padding: 1rem;
        padding-top: 3rem;
    }

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

    .brand-tagline {
        font-size: 0.9rem;
        margin-bottom: 2rem;
    }

    .features-list {
        gap: 1rem;
    }

    .feature {
        font-size: 0.9rem;
    }

    .feature-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .form-field {
        gap: 0.3rem;
    }

    .form-control {
        padding: 0.65rem;
        font-size: 16px;
        border-radius: 4px;
    }

    .auth-submit-btn {
        padding: 0.65rem;
        font-size: 0.9rem;
    }

    .divider {
        margin: 1.25rem 0;
        gap: 0.75rem;
        font-size: 0.85rem;
    }

    .modal-box {
        padding: 1.25rem;
    }

    .modal-icon {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }

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