/* ==========================================
   SMS Broadcast Platform - Login Styles
   Modern Multi-Tenant Authentication UI
   ========================================== */

/* Variables */
:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --neutral-50: #F9FAFB;
    --neutral-100: #F3F4F6;
    --neutral-200: #E5E7EB;
    --neutral-300: #D1D5DB;
    --neutral-400: #9CA3AF;
    --neutral-500: #6B7280;
    --neutral-600: #4B5563;
    --neutral-700: #374151;
    --neutral-800: #1F2937;
    --neutral-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Login Wrapper */
.login-wrapper {
    width: 100%;
    max-width: 480px;
    animation: fadeIn 0.5s ease-out;
}

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

/* Login Container */
.login-container {
    perspective: 1000px;
}

.login-box {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    transform-style: preserve-3d;
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: 0.5rem;
    animation: bounce 1s ease-in-out;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.tagline {
    font-size: 0.875rem;
    color: var(--neutral-500);
    margin: 0;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--neutral-100);
    padding: 0.375rem;
    border-radius: var(--radius-sm);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--neutral-600);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--neutral-900);
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: slideIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Forms */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--neutral-700);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--neutral-900);
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group input::placeholder {
    color: var(--neutral-400);
}

/* Subdomain Input */
.subdomain-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.subdomain-input-wrapper input {
    flex: 1;
    padding-right: 11rem;
}

.domain-suffix {
    position: absolute;
    right: 1rem;
    color: var(--neutral-400);
    font-size: 0.9375rem;
    pointer-events: none;
}

.input-hint {
    font-size: 0.75rem;
    color: var(--neutral-500);
    margin-top: -0.25rem;
}

/* Validation Message */
.validation-message {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.validation-message.show {
    display: block;
}

.validation-message.success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}

.validation-message.error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

/* Tenant Name Display */
.tenant-name-display {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tenant-name-display.show {
    display: block;
}

/* Admin Notice */
.admin-notice {
    background: var(--neutral-50);
    border-left: 4px solid var(--primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.notice-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.admin-notice p {
    font-size: 0.875rem;
    color: var(--neutral-600);
    margin: 0;
}

/* Error Message */
.error-message {
    padding: 0.75rem 1rem;
    background: #FEE2E2;
    border: 1px solid #FCA5A5;
    border-radius: var(--radius-sm);
    color: #991B1B;
    font-size: 0.875rem;
    font-weight: 500;
    display: none;
    animation: shake 0.4s ease-out;
}

.error-message.show {
    display: block;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Primary Button */
.btn-primary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--neutral-300);
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.btn-primary.loading .btn-text {
    opacity: 0;
}

.btn-primary.loading .btn-loader {
    display: block;
    position: absolute;
}

/* Footer */
.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--neutral-200);
    text-align: center;
}

.login-footer p {
    font-size: 0.75rem;
    color: var(--neutral-500);
    margin: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .login-box {
        padding: 1.5rem;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .subdomain-input-wrapper input {
        padding-right: 10rem;
    }
    
    .domain-suffix {
        font-size: 0.8125rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.tab-btn:focus-visible,
.form-group input:focus-visible,
.btn-primary:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}
