* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    min-height: 100vh;
    height: 100%;
    color: #333333;
    position: relative;
}

.login-container {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-header {
    margin-bottom: 20px;
}

.login-logo {
    height: 60px;
    width: auto;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.logo-link:hover {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.logo-container {
    position: relative;
    display: inline-block;
}

.beta-label {
    background: none;
    color: #ED6A18;
    font-size: 0.5rem;
    font-weight: 700;
    position: absolute;
    top: 12px;
    right: -30px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.login-link-container {
    margin-top: 2rem !important;
    margin-bottom: 1rem !important;
    text-align: center !important;
    font-size: 1rem !important;
    color: rgba(0, 0, 0, 0.6) !important;
    padding: 1.5rem !important;
    border-top: 2px solid rgba(0, 0, 0, 0.1) !important;
    width: 100% !important;
    max-width: 360px !important;
    display: block !important;
    background: transparent !important;
}

.login-link {
    color: #ED6A18 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    font-size: 1rem !important;
}

.login-link:hover {
    color: #DC5E14;
    text-decoration: underline;
}

.login-form-container {
    width: 100%;
    max-width: 360px;
}

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

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #333333;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #2B3A67;
    background: #ffffff;
}

.input-group input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #ED6A18;
}

.login-button {
    width: 100%;
    padding: 18px;
    background: #ED6A18;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.login-button:hover {
    background: #DC5E14;
}

.pin-login-button {
    width: 100%;
    background: #2B3A67;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pin-login-button svg {
    width: 20px;
    height: 20px;
}

.pin-login-button:hover {
    background: #1A2238;
    transform: translateY(-1px);
}

.login-button:active {
    transform: translateY(0);
}

.signup-link {
    text-align: center;
    margin-top: 20px;
    color: rgba(0, 0, 0, 0.6);
    font-size: 14px;
}

.signup-link a {
    color: #ED6A18;
    text-decoration: none;
    font-weight: 600;
}

.signup-link a:hover {
    text-decoration: underline;
}

/* Loading state */
.login-button.loading {
    opacity: 0.8;
    cursor: not-allowed;
    position: relative;
}

.login-button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error states */
.input-group.error input {
    border-color: #EF4444;
    background: rgba(254, 242, 242, 0.95);
}

.error-message {
    color: #EF4444;
    font-size: 14px;
    margin-top: 8px;
    text-align: center;
}

/* Success message */
.success-message {
    color: #2B3A67 !important;
    background-color: rgba(34, 197, 94, 0.1) !important;
    border: 1px solid rgba(34, 197, 94, 0.2) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    margin-top: 8px !important;
    text-align: center !important;
    display: block !important;
}

/* PIN Input Field */
.pin-input-group {
    position: relative;
}

.pin-input-group input {
    cursor: pointer;
}

.pin-input-group.error input {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.05);
}

.pin-input-group.error .pin-setup-btn {
    color: #ef4444;
}

.pin-setup-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-setup-btn:hover {
    color: #2B3A67;
}

.pin-setup-btn.pin-set {
    color: #2B3A67;
}

/* PIN Modal */
.pin-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pin-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    padding: 24px;
    position: relative;
}

.pin-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.pin-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111822;
}

.pin-modal-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.pin-modal-close:hover {
    background: rgba(107, 114, 128, 0.1);
}

.pin-modal-description {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: #666;
    text-align: center;
    line-height: 1.4;
}

.pin-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.pin-save-btn {
    flex: 1;
    background: #2B3A67;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.pin-save-btn:enabled:hover {
    background: #6b7356;
}

.pin-save-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.pin-description {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #666;
    text-align: center;
    line-height: 1.4;
}

.pin-display {
    display: flex;
    justify-content: center;
    margin: 12px 0;
}

.pin-dots {
    display: flex;
    gap: 12px;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border: 2px solid #e1e5e9;
    border-radius: 50%;
    background: transparent;
    transition: all 0.2s ease;
}

.pin-dot.filled {
    background: #2B3A67;
    border-color: #2B3A67;
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    max-width: 220px;
    margin: 12px auto;
}

.pin-key, .pin-clear, .pin-backspace {
    height: 42px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    background: #FFFFFF;
    font-size: 18px;
    font-weight: 600;
    color: #111822;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.pin-key:hover, .pin-clear:hover, .pin-backspace:hover {
    border-color: #2B3A67;
    background: #f8f9fa;
    transform: translateY(-1px);
}

.pin-key:active, .pin-clear:active, .pin-backspace:active {
    transform: translateY(0);
}

.pin-clear {
    font-size: 14px;
    font-weight: 500;
    color: #dc2626;
}

.pin-clear:hover {
    border-color: #dc2626;
    background: #fef2f2;
}

.pin-backspace {
    color: #6b7280;
}

.pin-backspace:hover {
    color: #374151;
}

.skip-pin-btn {
    display: block;
    margin: 8px auto 0;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.skip-pin-btn:hover {
    border-color: #2B3A67;
    color: #2B3A67;
}

/* Test preview section */
.test-preview-section {
    margin: 16px 0;
    text-align: center;
    display: none;
}

.test-btn {
    background: linear-gradient(135deg, #ED6A18 0%, #DC5E14 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.test-btn:hover {
    background: linear-gradient(135deg, #DC5E14 0%, #C55512 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 106, 24, 0.3);
}

/* Signup header styles */
.signup-header {
    text-align: center;
    margin-bottom: 40px;
    margin-top: 10px;
}

.signup-header h2 {
    color: #333333 !important;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.instant-approval {
    color: #2B3A67;
    font-size: 1.1rem;
    margin: 0;
}

.name-row {
    display: flex;
    gap: 12px;
}

.name-row .input-group {
    flex: 1;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .login-container {
        padding: 16px;
    }
    
    .login-logo {
        height: 50px;
    }
    
    .login-header {
        margin-bottom: 30px;
    }
    
    .login-form-container {
        max-width: 100%;
    }
}

@media (min-height: 800px) {
    .login-header {
        margin-bottom: 80px;
    }
}

/* Signup page specific styles */
.signup-header {
    text-align: center;
    margin-bottom: 40px;
    color: #111822;
}

.signup-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #111822;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
}

.brand-name .gear {
    color: #111822;
}

.brand-name .cred {
    color: #ED6A18;
}

.instant-approval {
    font-size: 14px;
    color: #22C55E;
    font-weight: 500;
    margin-top: 8px;
    background: rgba(34, 197, 94, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
}

.name-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.add-social-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(118, 132, 96, 0.1);
    border: none;
    color: #2B3A67;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.add-social-btn:hover {
    background: rgba(118, 132, 96, 0.2);
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 12px 0;
    padding: 8px 0;
    background: transparent;
    border-radius: 8px;
    border: none;
}

.checkbox-group input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin: 0;
    cursor: pointer;
    accent-color: #2B3A67;
}

.checkbox-group label {
    font-size: 14px;
    color: #333333;
    line-height: 1.4;
    cursor: pointer;
}

.additional-social {
    margin-bottom: 20px;
}

.social-url-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.remove-social-btn {
    background: rgba(239, 68, 68, 0.1);
    border: none;
    color: #EF4444;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.remove-social-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Responsive adjustments for signup */
@media (max-width: 480px) {
    .name-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .signup-header h2 {
        font-size: 18px;
    }
    
    .brand-name {
        font-size: 18px;
    }
    
    .checkbox-group {
        padding: 12px;
    }
}

/* User Selection Overlay */
.user-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.user-selection-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    padding: 24px;
    text-align: center;
}

.user-selection-content h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: #111822;
}

.user-selection-content p {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: #666;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.user-option {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.user-option:hover {
    border-color: #2B3A67;
    background: rgba(118, 132, 96, 0.05);
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: #111822;
    margin-bottom: 4px;
}

.user-email {
    font-size: 14px;
    color: #666;
}

.back-btn {
    background: #d1d5db;
    color: #6b7280;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.back-btn:hover {
    background: #9ca3af;
}