/**
 * TCS Signup Modal Styles
 * v1.4.0 — Sign In / Sign Up toggle, confirm password, password toggle, success view
 * Brand: Dark blue (#1a1a2e, #2b2d42), Teal (#4dc4d9), Orange (#e67e22)
 * Fonts: Orbitron (headings), Poppins (body)
 */

/* Overlay */
.tcs-signup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Card */
.tcs-signup-card {
    background: #ffffff;
    border-radius: 12px;
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
}

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

/* Header */
.tcs-signup-header {
    text-align: center;
    padding: 32px 32px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.tcs-signup-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.tcs-signup-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
}

.tcs-signup-header p {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Body */
.tcs-signup-body {
    padding: 32px;
}

/* Google Button */
.tcs-google-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 24px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tcs-google-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tcs-google-btn svg {
    flex-shrink: 0;
}

/* Divider */
.tcs-divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
}

.tcs-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: #e5e7eb;
}

.tcs-divider span {
    position: relative;
    display: inline-block;
    padding: 0 16px;
    background: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #9ca3af;
}

/* Form */
#tcsSignupForm {
    margin-top: 24px;
}

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

.tcs-form-group label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.tcs-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    color: #1f2937;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.tcs-form-group input:focus {
    outline: none;
    border-color: #4dc4d9;
    box-shadow: 0 0 0 3px rgba(77, 196, 217, 0.1);
}

.tcs-form-group input::placeholder {
    color: #9ca3af;
}

.tcs-form-group small {
    display: block;
    margin-top: 4px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: #9ca3af;
}

/* Password wrapper with show/hide toggle */
.tcs-password-wrapper {
    position: relative;
}

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

.tcs-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.tcs-password-toggle:hover {
    color: #64748b;
}

/* Field-level errors */
.tcs-field-error {
    display: block;
    margin-top: 4px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: #dc2626;
}

/* Error */
.tcs-error {
    margin: 16px 0;
    padding: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #dc2626;
    display: none;
}

.tcs-error:not(:empty) {
    display: block;
}

/* Submit Button */
.tcs-submit-btn {
    width: 100%;
    position: relative;
    padding: 14px 24px;
    background: linear-gradient(135deg, #4dc4d9, #3a9fb0);
    border: none;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.tcs-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #3a9fb0, #2d7d8a);
    box-shadow: 0 4px 12px rgba(77, 196, 217, 0.3);
    transform: translateY(-1px);
}

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

.tcs-submit-btn span {
    transition: opacity 0.2s ease;
}

/* Spinner */
.tcs-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Toggle Sign In / Sign Up */
.tcs-toggle-mode {
    margin-top: 16px;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #6b7280;
}

.tcs-toggle-mode a {
    color: #4dc4d9;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.tcs-toggle-mode a:hover {
    color: #3a9fb0;
    text-decoration: underline;
}

/* Signup-only fields — smooth hide/show */
.tcs-signup-only {
    transition: opacity 0.2s ease, max-height 0.3s ease;
    overflow: hidden;
}

/* Footer */
.tcs-signup-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #9ca3af;
}

/* ═══════════════════════════════
   SUCCESS VIEW
   ═══════════════════════════════ */

.tcs-success-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.tcs-success-content {
    text-align: center;
    padding: 48px 32px;
}

.tcs-success-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.tcs-success-content h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 12px;
}

.tcs-success-content p {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 28px;
}

.tcs-success-close-btn {
    padding: 12px 40px;
    background: linear-gradient(135deg, #4dc4d9, #3a9fb0);
    border: none;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tcs-success-close-btn:hover {
    background: linear-gradient(135deg, #3a9fb0, #2d7d8a);
    box-shadow: 0 4px 12px rgba(77, 196, 217, 0.3);
    transform: translateY(-1px);
}

/* ═══════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════ */

@media (max-width: 480px) {
    .tcs-signup-card {
        max-width: 100%;
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .tcs-signup-form-view {
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow: hidden;
    }

    .tcs-signup-body {
        flex: 1;
        overflow-y: auto;
        padding: 24px 20px;
    }

    .tcs-signup-header {
        padding: 24px 20px 20px;
    }

    .tcs-signup-header h2 {
        font-size: 22px;
    }

    .tcs-success-view {
        min-height: auto;
        flex: 1;
    }
}

/* Accessibility */
.tcs-form-group input:invalid:not(:placeholder-shown) {
    border-color: #fca5a5;
}

.tcs-form-group input:valid:not(:placeholder-shown) {
    border-color: #86efac;
}
