/* Registration Modal Styles */
/* Based on Claude Web interface with modifications: no logo, no social buttons */

/* Modal backdrop and container */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.light-mode .modal {
    background: rgba(0, 0, 0, 0.4);
}

/* Modal content container */
.modal-content {
    background: var(--color-bg-card);
    border-radius: 16px;
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-width: 500px;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
    transform: scale(0.95) translateY(30px);
    position: relative;
}

.light-mode .modal-content {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
}

/* Modal header */
.modal-header {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
    color: white;
    padding: 32px 24px;
    text-align: center;
    position: relative;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" patternUnits="userSpaceOnUse" width="100" height="100"><circle cx="25" cy="25" r="0.5" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="0.5" fill="white" opacity="0.05"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.08"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
    position: relative;
    z-index: 1;
    margin: 0;
}

.modal-header p {
    font-size: 14px;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    margin: 8px 0 0 0;
}

/* Close button */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Form container */
.modal-body {
    padding: 32px 24px;
    color: var(--color-text-primary);
}

/* Form groups and inputs */
.form-group {
    margin-bottom: 20px;
}

.form-label,
.auth-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.form-input,
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.form-input:focus,
.auth-form input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-input::placeholder,
.auth-form input::placeholder {
    color: var(--color-text-secondary);
}

/* Form row for first/last name */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Checkbox groups */
.checkbox-group,
.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 24px 0;
}

.checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.checkbox input[type="checkbox"]:checked + .checkmark,
.checkbox input[type="checkbox"]:checked ~ .checkmark {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.checkbox input[type="checkbox"]:checked + .checkmark::after,
.checkbox input[type="checkbox"]:checked ~ .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    background: transparent;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.5;
    cursor: pointer;
    flex: 1;
}

.checkbox-label a {
    color: var(--color-accent);
    text-decoration: none;
}

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

.privacy-note {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--color-text-secondary);
    font-style: italic;
}

/* Primary button */
.primary-button,
.auth-btn {
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-bottom: 16px;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}

.primary-button:hover,
.auth-btn:hover {
    background: var(--color-accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.primary-button:disabled,
.auth-btn:disabled {
    background: var(--color-text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Apple-style loading button */
.auth-btn.loading {
    background: var(--color-accent);
    position: relative;
    color: transparent;
    pointer-events: none;
    /* Maintain exact button dimensions */
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    height: auto;
    min-height: 52px; /* Ensure consistent height */
    box-sizing: border-box;
}

.loading-spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px; /* Match button font-size */
    font-weight: 600; /* Match button font-weight */
    margin-left: 28px;
    white-space: nowrap;
    letter-spacing: -0.01em; /* Match button letter-spacing */
}

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

/* Login link */
.auth-switch {
    text-align: center;
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-top: 16px;
}

.auth-switch a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Message styles */
.auth-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
}

.auth-message.error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--color-error);
    color: var(--color-error);
    display: block;
}

.auth-message.success {
    background: rgba(48, 209, 88, 0.1);
    border: 1px solid var(--color-success);
    color: var(--color-success);
    display: block;
}

/* Pulse animation for button */
.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .modal-content {
        margin: 10px;
        border-radius: 12px;
        max-width: none;
        width: calc(100% - 20px);
    }
    
    .modal-header {
        padding: 24px 20px;
    }
    
    .modal-body {
        padding: 24px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .modal-close {
        top: 16px;
        right: 16px;
        padding: 6px 10px;
        font-size: 16px;
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        margin: 0;
        width: 100%;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .modal-header p {
        font-size: 13px;
    }
}

/* Theme integration is now handled by CSS variables above */

/* Ensure proper z-index layering */
.modal {
    z-index: 10000;
}