/**
 * Custom Login Page Styles
 */

.tia-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
}

.tia-login-box {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.tia-login-header {
    padding: 40px 40px 30px;
    text-align: center;
    background: linear-gradient(135deg, #1a365d 0%, #2d4a77 100%);
    color: #fff;
}

.tia-login-logo {
    max-width: 180px;
    max-height: 60px;
    margin-bottom: 20px;
}

.tia-login-site-name {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 15px;
    color: #fff;
}

.tia-login-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #fff;
}

.tia-login-subtitle {
    font-size: 14px;
    margin: 0;
    opacity: 0.85;
    color: #e2e8f0;
}

.tia-login-content {
    padding: 35px 40px;
}

.tia-login-footer {
    padding: 20px 40px 30px;
    text-align: center;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.tia-login-footer p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

.tia-login-footer a {
    color: #1a365d;
    font-weight: 600;
    text-decoration: none;
}

.tia-login-footer a:hover {
    text-decoration: underline;
}

/* Forms */
.tia-form {
    width: 100%;
}

.tia-form-group {
    margin-bottom: 20px;
}

.tia-form-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.tia-form-row {
    display: flex;
    gap: 15px;
}

.tia-form-half {
    flex: 1;
}

.tia-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.tia-input:focus {
    outline: none;
    border-color: #1a365d;
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.tia-input::placeholder {
    color: #94a3b8;
}

.tia-password-wrapper {
    position: relative;
}

.tia-password-wrapper .tia-input {
    padding-right: 48px;
}

.tia-toggle-password,
.tia-login-container .tia-toggle-password,
button.tia-toggle-password {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    padding: 5px !important;
    color: #64748b !important;
    transition: color 0.2s ease !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
}

.tia-toggle-password:hover,
.tia-toggle-password:focus,
.tia-toggle-password:active,
.tia-login-container .tia-toggle-password:hover,
.tia-login-container .tia-toggle-password:focus,
.tia-login-container .tia-toggle-password:active {
    color: #1a365d !important;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    background: none !important;
    background-color: transparent !important;
}

.tia-forgot-link {
    font-size: 13px;
    font-weight: 500;
    color: #1a365d;
    text-decoration: none;
}

.tia-forgot-link:hover {
    text-decoration: underline;
}

.tia-form-hint {
    font-size: 12px;
    color: #64748b;
    margin: 6px 0 0;
}

/* Checkboxes - strong overrides for theme compatibility */
.tia-checkbox-label,
.tia-login-container .tia-checkbox-label,
.tia-login-box .tia-checkbox-label,
label.tia-checkbox-label {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    font-weight: 400 !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
}

.tia-checkbox-label input[type="checkbox"],
.tia-login-container .tia-checkbox-label input[type="checkbox"],
.tia-login-box input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    accent-color: #1a365d !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
}

.tia-checkbox-label span,
.tia-login-container .tia-checkbox-label span {
    font-size: 14px !important;
    color: #4b5563 !important;
    line-height: 1 !important;
    display: inline !important;
}

.tia-checkbox-label a {
    color: #1a365d;
    text-decoration: none;
}

.tia-checkbox-label a:hover {
    text-decoration: underline;
}

.tia-remember-me {
    margin-bottom: 25px;
}

/* Remember me + Forgot password row - strong overrides */
.tia-remember-forgot,
.tia-login-container .tia-remember-forgot,
.tia-login-box .tia-remember-forgot,
.tia-form .tia-remember-forgot,
div.tia-remember-forgot {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 25px !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
}

.tia-remember-forgot .tia-checkbox-label,
.tia-login-container .tia-remember-forgot .tia-checkbox-label {
    margin: 0 !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

.tia-remember-forgot .tia-forgot-link,
.tia-login-container .tia-remember-forgot .tia-forgot-link,
a.tia-forgot-link {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #c41e3a !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
    white-space: nowrap !important;
    display: inline-block !important;
}

.tia-remember-forgot .tia-forgot-link:hover,
.tia-login-container .tia-remember-forgot .tia-forgot-link:hover,
a.tia-forgot-link:hover {
    color: #a01830 !important;
    text-decoration: underline !important;
}

.tia-terms {
    margin-bottom: 25px;
}

/* Buttons */
.tia-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tia-btn-primary {
    background: linear-gradient(135deg, #1a365d 0%, #2d4a77 100%);
    color: #fff;
}

.tia-btn-primary:hover {
    background: linear-gradient(135deg, #15294a 0%, #243c61 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.25);
}

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

.tia-btn-secondary {
    background: #f1f5f9;
    color: #1a365d;
    border: 2px solid #e2e8f0;
}

.tia-btn-secondary:hover {
    background: #e2e8f0;
}

.tia-btn-full {
    width: 100%;
}

/* Messages */
.tia-message {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.tia-message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.tia-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.tia-notice {
    padding: 20px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 8px;
    text-align: center;
}

/* Logged in state */
.tia-logged-in .tia-login-content {
    padding: 30px 40px;
}

.tia-welcome-message {
    text-align: center;
    font-size: 16px;
    color: #374151;
    margin-bottom: 25px;
}

.tia-login-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Loading state */
.tia-btn.loading {
    position: relative;
    pointer-events: none;
}

.tia-btn.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: tia-spin 0.8s linear infinite;
    margin-left: 10px;
}

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

/* Responsive */
@media (max-width: 480px) {
    .tia-login-container {
        padding: 20px 15px;
    }
    
    .tia-login-header,
    .tia-login-content,
    .tia-login-footer {
        padding-left: 25px;
        padding-right: 25px;
    }
    
    .tia-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .tia-login-title {
        font-size: 22px;
    }
}
