/**
 * TVStartup OTT Platform - Frontend Login Styles
 *
 * Styles for the [ts_ott_login] and [ts_ott_logout] shortcodes.
 *
 * @package Tvstartup_OTT_Platform
 * @since   1.3.0
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

.ts-ott-login-wrapper {
    --ts-ott-primary: #2271b1;
    --ts-ott-primary-hover: #135e96;
    --ts-ott-primary-light: rgba(34, 113, 177, 0.08);
    --ts-ott-success: #00a32a;
    --ts-ott-success-bg: rgba(0, 163, 42, 0.08);
    --ts-ott-error: #d63638;
    --ts-ott-error-bg: rgba(214, 54, 56, 0.08);
    --ts-ott-text: #1d2327;
    --ts-ott-text-light: #646970;
    --ts-ott-border: #c3c4c7;
    --ts-ott-border-light: #dcdcde;
    --ts-ott-bg: #f0f0f1;
    --ts-ott-bg-white: #ffffff;
    --ts-ott-radius: 6px;
    --ts-ott-radius-lg: 12px;
    --ts-ott-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* ==========================================================================
   Login Wrapper & Card
   ========================================================================== */

.ts-ott-login-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 0;
    font-family: var(--ts-ott-font-family);
    line-height: 1.5;
    box-sizing: border-box;
}

.ts-ott-login-wrapper *,
.ts-ott-login-wrapper *::before,
.ts-ott-login-wrapper *::after {
    box-sizing: border-box;
}

.ts-ott-login-card {
    background: var(--ts-ott-bg-white);
    border: 1px solid var(--ts-ott-border-light);
    border-radius: var(--ts-ott-radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

/* ==========================================================================
   Login Header
   ========================================================================== */

.ts-ott-login-header {
    padding: 28px 32px 20px;
    border-bottom: 1px solid var(--ts-ott-border-light);
    background: linear-gradient(to bottom, #fafbfc, var(--ts-ott-bg-white));
}

.ts-ott-login-header h3 {
    margin: 0 0 6px 0;
    padding: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--ts-ott-text);
    line-height: 1.3;
}

.ts-ott-login-header p {
    margin: 0;
    padding: 0;
    font-size: 14px;
    color: var(--ts-ott-text-light);
    line-height: 1.5;
}

/* ==========================================================================
   Login Body
   ========================================================================== */

.ts-ott-login-body {
    padding: 28px 32px 32px;
}

/* ==========================================================================
   Messages
   ========================================================================== */

.ts-ott-login-messages {
    margin-bottom: 0;
}

.ts-ott-login-error,
.ts-ott-login-success {
    padding: 12px 16px;
    border-radius: var(--ts-ott-radius);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.ts-ott-login-error {
    background: var(--ts-ott-error-bg);
    color: var(--ts-ott-error);
    border: 1px solid rgba(214, 54, 56, 0.2);
}

.ts-ott-login-success {
    background: var(--ts-ott-success-bg);
    color: #006b1a;
    border: 1px solid rgba(0, 163, 42, 0.2);
}

/* ==========================================================================
   Form Groups
   ========================================================================== */

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

.ts-ott-form-group:last-child {
    margin-bottom: 0;
}

.ts-ott-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ts-ott-text);
}

/* ==========================================================================
   Input Fields
   ========================================================================== */

.ts-ott-form-input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    font-family: var(--ts-ott-font-family);
    line-height: 1.5;
    color: var(--ts-ott-text);
    background-color: var(--ts-ott-bg-white);
    border: 1px solid var(--ts-ott-border);
    border-radius: var(--ts-ott-radius);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.ts-ott-form-input:hover {
    border-color: #8c8f94;
}

.ts-ott-form-input:focus {
    border-color: var(--ts-ott-primary);
    box-shadow: 0 0 0 3px var(--ts-ott-primary-light);
}

.ts-ott-form-input::placeholder {
    color: #a7aaad;
}

/* ==========================================================================
   Password Field with Toggle
   ========================================================================== */

.ts-ott-password-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
}

.ts-ott-password-wrapper .ts-ott-form-input {
    padding-right: 48px;
}

.ts-ott-toggle-password {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--ts-ott-text-light);
    padding: 0;
    transition: color 0.2s ease;
}

.ts-ott-toggle-password:hover {
    color: var(--ts-ott-primary);
}

.ts-ott-toggle-password svg {
    display: block;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.ts-ott-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--ts-ott-font-family);
    line-height: 1;
    border-radius: var(--ts-ott-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    -webkit-appearance: none;
    appearance: none;
}

.ts-ott-btn:focus-visible {
    outline: 2px solid var(--ts-ott-primary);
    outline-offset: 2px;
}

/* Primary Login Button */
.ts-ott-btn-login {
    width: 100%;
    padding: 14px 24px;
    background: var(--ts-ott-primary);
    color: #ffffff;
    font-size: 16px;
}

.ts-ott-btn-login:hover {
    background: var(--ts-ott-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.3);
}

.ts-ott-btn-login:active {
    transform: translateY(0);
    box-shadow: none;
}

.ts-ott-btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Logout Button */
.ts-ott-btn-logout {
    background: transparent;
    color: var(--ts-ott-error);
    border: 1px solid var(--ts-ott-error);
    padding: 10px 20px;
    font-size: 14px;
}

.ts-ott-btn-logout:hover {
    background: var(--ts-ott-error);
    color: #ffffff;
}

.ts-ott-btn-logout:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ==========================================================================
   Spinner Animation
   ========================================================================== */

.ts-ott-btn-spinner {
    display: inline-flex;
    align-items: center;
}

.ts-ott-spinner-svg {
    animation: ts-ott-spin 1s linear infinite;
}

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

/* ==========================================================================
   Logged-In State
   ========================================================================== */

.ts-ott-logged-in .ts-ott-login-body {
    text-align: center;
}

.ts-ott-welcome-text {
    margin: 0 0 20px 0;
    font-size: 15px;
    color: var(--ts-ott-text);
    line-height: 1.6;
}

.ts-ott-welcome-text strong {
    color: var(--ts-ott-primary);
}

/* ==========================================================================
   Logout Form (standalone shortcode)
   ========================================================================== */

.ts-ott-logout-form {
    display: inline-block;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   Form Submit Group
   ========================================================================== */

.ts-ott-form-submit {
    margin-top: 24px;
}

/* ==========================================================================
   Forgot Password Link
   ========================================================================== */

.ts-ott-forgot-password-link {
    text-align: right;
    margin-top: 12px;
    margin-bottom: 0;
}

.ts-ott-forgot-password-link a {
    font-size: 14px;
    color: var(--ts-ott-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.ts-ott-forgot-password-link a:hover {
    color: var(--ts-ott-primary-hover);
    text-decoration: underline;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media screen and (max-width: 480px) {
    .ts-ott-login-wrapper {
        padding: 10px 0;
    }

    .ts-ott-login-card {
        border-radius: var(--ts-ott-radius);
        border-left: none;
        border-right: none;
    }

    .ts-ott-login-header {
        padding: 20px;
    }

    .ts-ott-login-header h3 {
        font-size: 20px;
    }

    .ts-ott-login-body {
        padding: 20px;
    }

    .ts-ott-btn-login {
        padding: 12px 20px;
        font-size: 15px;
    }
}
