/* Card2Crypto Core Styles */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #1a202c;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Better font rendering for RTL languages (Hebrew, Arabic) */
body.rtl {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: auto;
}

/* Improve Hebrew text rendering */
body.rtl .hero-title,
body.rtl .hero-subtitle {
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Layout Helpers */
.container,
.welcome-container,
.auth-container {
    width: 100%;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Welcome Page */
.welcome-container {
    max-width: 1100px;
    padding: 24px 20px 40px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.welcome-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 32px;
}

.welcome-header .logo-text {
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    transition: color 0.25s ease;
}

.nav-link:hover {
    color: #ffffff;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 10px;
    background: #ffffff;
    color: #667eea;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.25);
}

.hero-section {
    text-align: center;
    padding: 80px 20px 120px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hero-title {
    font-size: clamp(2.75rem, 6vw, 4.25rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.2;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.hero-description {
    max-width: 640px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.15rem;
    line-height: 1.75;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border 0.3s ease;
}

.btn-hero.btn-primary {
    background: #ffffff;
    color: #667eea;
}

.btn-hero.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(255, 255, 255, 0.28);
}

.btn-hero.btn-secondary {
    border: 2px solid rgba(255, 255, 255, 0.55);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.btn-hero.btn-secondary:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-3px);
}

.btn-hero.btn-support {
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(102, 126, 234, 0.18);
    color: #ffffff;
}

.btn-hero.btn-support:hover {
    background: rgba(118, 75, 162, 0.28);
    border-color: #ffffff;
    transform: translateY(-3px);
}

.btn-hero.btn-support svg {
    flex-shrink: 0;
}

.welcome-footer {
    margin-top: auto;
    padding: 48px 0 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
}

/* Auth Pages */
.auth-container {
    max-width: 500px;
    padding: 60px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-card {
    width: 100%;
    background: #ffffff;
    border-radius: 20px;
    padding: 48px;
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.16);
    animation: fadeInUp 0.6s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .logo {
    justify-content: center;
    margin-bottom: 24px;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
}

.auth-header p {
    color: #718096;
    font-size: 1rem;
}

.auth-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2d3748;
}

.form-input,
textarea.form-control,
select.form-control {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 1rem;
    color: #1a202c;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    font-family: inherit;
}

.form-input:focus,
textarea.form-control:focus,
select.form-control:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #718096;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

/* Fix RTL password toggle position */
body.rtl .password-toggle {
    right: auto;
    left: 12px;
}

.password-toggle:hover {
    background: #edf2f7;
    color: #4a5568;
}

.form-hint {
    font-size: 0.8rem;
    color: #a0aec0;
}

.error-message,
.success-message {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 18px;
    display: none;
}

.error-message {
    background: #fff5f5;
    color: #c53030;
    border-left: 4px solid #f56565;
}

.success-message {
    background: #f0fff4;
    color: #276749;
    border-left: 4px solid #48bb78;
}

.auth-button {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.auth-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.35);
}

.auth-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.button-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.auth-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.auth-footer p {
    color: #718096;
    font-size: 0.9rem;
}

.auth-link {
    color: #667eea;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: #764ba2;
}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 12px;
}

.language-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.language-option:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.language-option.active {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-weight: 600;
}

.language-name {
    line-height: 1;
}

/* Auth page language switcher */
.auth-language-switcher {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.auth-language-switcher .language-option {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    color: #4a5568;
    font-size: 0.8125rem;
    font-weight: 500;
    background: #ffffff;
}

.auth-language-switcher .language-option:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f7fafc;
}

.auth-language-switcher .language-option.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-weight: 600;
}

/* Utilities */
.text-muted {
    color: #718096;
}

.small-text {
    font-size: 0.75rem;
}

.muted-secondary {
    color: #a0aec0;
}

.inline-gap-start-sm {
    margin-inline-start: 8px;
}

.inline-gap-end-sm {
    margin-inline-end: 8px;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Responsive */
@media (max-width: 900px) {
    .welcome-header {
        flex-direction: column;
        gap: 16px;
    }

    .nav-menu {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .welcome-container {
        padding: 20px 16px 32px;
    }

    .hero-section {
        padding: 60px 0 80px;
    }

    .hero-description {
        font-size: 1.05rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-hero {
        width: 100%;
    }

    .auth-card {
        padding: 32px 24px;
    }
}

@media (max-width: 420px) {
    .welcome-header .logo-text {
        font-size: 1.5rem;
    }

    .nav-menu {
        flex-direction: column;
        gap: 12px;
    }

    .btn-primary {
        width: 100%;
    }
}
