/* ==============================================
   🔥 TEMPLINES AUTH - FINAL PERFECT STYLES
   Modern, Clean, Professional
   https://templines.com/
   ============================================== */

/* ==============================================
   BASE VARIABLES
   ============================================== */
:root {
    --tlaw-primary: #2563eb;
    --tlaw-primary-hover: #1d4ed8;
    --tlaw-primary-light: #dbeafe;
    --tlaw-success: #10b981;
    --tlaw-error: #ef4444;
    --tlaw-border: #e5e7eb;
    --tlaw-text: #1f2937;
    --tlaw-text-muted: #6b7280;
    --tlaw-bg: #ffffff;
    --tlaw-bg-hover: #f9fafb;
    --tlaw-radius: 12px;
    --tlaw-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ==============================================
   WRAPPER & AUTH CONTAINER
   ============================================== */
.tlaw-auth-wrapper {
    max-width: 460px;
    margin: 3rem auto;
    background: var(--tlaw-bg);
    border-radius: var(--tlaw-radius);
    box-shadow: var(--tlaw-shadow);
    overflow: hidden;
}

/* ==============================================
   TABS NAVIGATION
   ============================================== */
.tlaw-auth-tabs {
    display: flex;
    gap: 0;
    background: var(--tlaw-bg-hover);
    border-bottom: 2px solid var(--tlaw-border);
}

.tlaw-tab-btn {
    flex: 1;
    padding: 18px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--tlaw-text-muted);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.tlaw-tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--tlaw-primary);
    transform: scaleX(0);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tlaw-tab-btn:hover {
    color: var(--tlaw-text);
    background: rgba(37, 99, 235, 0.04);
}

.tlaw-tab-btn.active {
    color: var(--tlaw-primary);
    background: var(--tlaw-bg);
}

.tlaw-tab-btn.active::after {
    transform: scaleX(1);
}

.tlaw-tab-btn[data-tab="forgot"] {
    display: none !important;
}

/* ==============================================
   TAB CONTENT
   ============================================== */
.tlaw-tab-content {
    display: none;
    padding: 40px 36px;
    animation: fadeIn 0.3s ease;
}

.tlaw-tab-content.active {
    display: block;
}

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

/* ==============================================
   FORM ELEMENTS
   ============================================== */
.tlaw-auth-wrapper .tlaw-form {
    max-width: none;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
}

.tlaw-auth-wrapper .tlaw-form__title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--tlaw-text);
    letter-spacing: -0.02em;
}

.tlaw-auth-wrapper .tlaw-form__text {
    text-align: center;
    margin-bottom: 32px;
    font-size: 15px;
    color: var(--tlaw-text-muted);
    line-height: 1.5;
}

.tlaw-auth-wrapper .tlaw-form__body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tlaw-auth-wrapper .tlaw-form__row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tlaw-auth-wrapper .tlaw-form__label {
    font-size: 14px;
    font-weight: 600;
    color: var(--tlaw-text);
    margin-bottom: 0;
}

.tlaw-auth-wrapper .tlaw-input {
    padding: 14px 16px;
    border: 2px solid var(--tlaw-border);
    border-radius: 10px;
    font-size: 15px;
    color: var(--tlaw-text);
    background: var(--tlaw-bg);
    transition: all 0.2s ease;
    outline: none;
}

.tlaw-auth-wrapper .tlaw-input:hover {
    border-color: #d1d5db;
}

.tlaw-auth-wrapper .tlaw-input:focus {
    border-color: var(--tlaw-primary);
    background: var(--tlaw-primary-light);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.tlaw-auth-wrapper .tlaw-input::placeholder {
    color: #9ca3af;
}

/* ==============================================
   CHECKBOX & INLINE ROW
   ============================================== */
.tlaw-auth-wrapper .tlaw-form__row--inline {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    gap: 12px;
}

.tlaw-auth-wrapper .tlaw-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.tlaw-auth-wrapper .tlaw-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--tlaw-primary);
    border-radius: 4px;
}

.tlaw-auth-wrapper .tlaw-checkbox span {
    font-size: 14px;
    color: var(--tlaw-text);
    font-weight: 500;
}

/* ==============================================
   BUTTONS
   ============================================== */
.tlaw-auth-wrapper .tlaw-button {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.tlaw-auth-wrapper .tlaw-button--primary {
    background: var(--tlaw-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.tlaw-auth-wrapper .tlaw-button--primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity 0.2s;
}

.tlaw-auth-wrapper .tlaw-button--primary:hover {
    background: var(--tlaw-primary-hover);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
    transform: translateY(-2px);
}

.tlaw-auth-wrapper .tlaw-button--primary:hover::before {
    opacity: 1;
}

.tlaw-auth-wrapper .tlaw-button--primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.tlaw-auth-wrapper .tlaw-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ==============================================
   LINKS
   ============================================== */
.tlaw-auth-wrapper .tlaw-link {
    color: var(--tlaw-primary);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

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

/* ==============================================
   SOCIAL BUTTONS
   ============================================== */
.tlaw-social-buttons {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--tlaw-border);
}

.tlaw-social-buttons__title {
    margin: 0 0 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--tlaw-text-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tlaw-social-buttons__grid {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.tlaw-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 2px solid var(--tlaw-border);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--tlaw-bg);
}

.tlaw-social-btn span {
    display: none;
}

.tlaw-social-btn svg {
    width: 25px;
    height: 25px;
    flex-shrink: 0;
    display: block;
}

/* Google */
.tlaw-social-btn--google {
    border-color: #dadce0;
    color: #3c4043;
}

.tlaw-social-btn--google:hover {
    background: #f8f9fa;
    border-color: #5f6368;
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.15);
    transform: translateY(-2px);
}

/* VK */
.tlaw-social-btn--vk {
    border-color: #0077ff;
    color: #ffffff;
    background: #0077ff;
}

.tlaw-social-btn--vk:hover {
    background: #0066dd;
    border-color: #0066dd;
    box-shadow: 0 4px 12px rgba(0, 119, 255, 0.3);
    transform: translateY(-2px);
}

/* Yandex */
.tlaw-social-btn--yandex {
    border-color: #fc3f1d;
    color: #ffffff;
    background: #fc3f1d;
}

.tlaw-social-btn--yandex:hover {
    background: #e63600;
    border-color: #e63600;
    box-shadow: 0 4px 12px rgba(252, 63, 29, 0.3);
    transform: translateY(-2px);
}

.tlaw-social-btn:active {
    transform: translateY(0) !important;
}

/* ==============================================
   FORM FOOTER
   ============================================== */
.tlaw-auth-wrapper .tlaw-form__footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--tlaw-border);
    text-align: center;
    font-size: 14px;
    color: var(--tlaw-text-muted);
}

/* ==============================================
   VERIFICATION SCREENS (EMAIL & RESET)
   ============================================== */
.tlaw-verify-wrapper {
    max-width: 480px;
    margin: 3rem auto;
    padding: 48px 40px;
    background: var(--tlaw-bg);
    border-radius: var(--tlaw-radius);
    box-shadow: var(--tlaw-shadow);
}

.tlaw-verify-icon {
    text-align: center;
    margin-bottom: 24px;
}

.tlaw-verify-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    color: var(--tlaw-text);
    letter-spacing: -0.02em;
}

.tlaw-verify-text {
    text-align: center;
    color: var(--tlaw-text-muted);
    margin-bottom: 32px;
    font-size: 15px;
    line-height: 1.6;
}

.tlaw-verify-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tlaw-input--code {
    font-size: 32px;
    text-align: center;
    letter-spacing: 12px;
    font-weight: 700;
    padding: 20px;
    font-family: 'Courier New', monospace;
}

.tlaw-verify-resend {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--tlaw-border);
}

.tlaw-verify-resend p {
    color: var(--tlaw-text-muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.tlaw-verify-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--tlaw-border);
    text-align: center;
}

/* ==============================================
   ALREADY LOGGED IN SCREEN
   ============================================== */
.tlaw-already-logged {
    max-width: 520px;
    margin: 3rem auto;
    padding: 48px 40px;
    text-align: center;
    border: 1px solid var(--tlaw-border);
    border-radius: var(--tlaw-radius);
    background: var(--tlaw-bg);
    box-shadow: var(--tlaw-shadow);
}

.tlaw-already-logged svg {
    margin: 0 auto 24px;
    display: block;
}

.tlaw-already-logged h3 {
    margin: 0 0 12px;
    font-size: 28px;
    color: var(--tlaw-text);
    font-weight: 700;
}

.tlaw-already-logged p {
    margin: 0 0 28px;
    color: var(--tlaw-text-muted);
    font-size: 15px;
}

.tlaw-link-muted {
    color: var(--tlaw-text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.tlaw-link-muted:hover {
    color: var(--tlaw-text);
    text-decoration: underline;
}

/* ==============================================
   FLASH MESSAGES
   ============================================== */
.tlaw-flash {
    margin: 0 auto 24px;
    max-width: 460px;
}

.tlaw-flash__item {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

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

.tlaw-flash__item--success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.tlaw-flash__item--error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.tlaw-flash__item--info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ==============================================
   LOADING STATE
   ============================================== */
.tlaw-button.is-loading,
.tlaw-social-btn.is-loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.tlaw-button.is-loading::after,
.tlaw-social-btn.is-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.6s linear infinite;
}

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

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 640px) {
    .tlaw-auth-wrapper,
    .tlaw-verify-wrapper,
    .tlaw-already-logged {
        margin: 2rem 16px;
        max-width: calc(100% - 32px);
    }
    
    .tlaw-tab-content,
    .tlaw-verify-wrapper,
    .tlaw-already-logged {
        padding: 32px 24px;
    }
    
    .tlaw-tab-btn {
        padding: 16px 20px;
        font-size: 14px;
    }
    
    .tlaw-auth-wrapper .tlaw-form__title,
    .tlaw-verify-title,
    .tlaw-already-logged h3 {
        font-size: 24px;
    }
    
    .tlaw-social-btn {
        width: 44px;
        height: 44px;
    }
    
    .tlaw-social-btn svg {
        width: 22px;
        height: 22px;
    }
    
    .tlaw-input--code {
        font-size: 28px;
        letter-spacing: 8px;
    }
}

/* ==============================================
   FOCUS STATES FOR ACCESSIBILITY
   ============================================== */
.tlaw-button:focus-visible,
.tlaw-social-btn:focus-visible,
.tlaw-link:focus-visible {
    outline: 2px solid var(--tlaw-primary);
    outline-offset: 2px;
}

.tlaw-input:focus-visible {
    outline: none;
}

/* ==============================================
   SMOOTH TRANSITIONS
   ============================================== */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}