/* Reset & Variables */
html {
    overflow-x: hidden;
}

:root {
    --bg-dark: #050505;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent-color: #FF3B30; /* Cinematic Red */
    --accent-hover: #E6352B;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Cinematic Background - Locked & Static */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.75)), url('/contactform/Assets/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    backface-visibility: hidden; /* Fix for mobile jitter */
}

.bg-gradient-orb {
    display: none; /* Hide orbs to keep focus on the image */
}

@keyframes moveOrb {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 100px) scale(1.1); }
}

/* Layout */
.page-wrapper {
    max-width: 1200px;
    width: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* Header */
.header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5rem;
    animation: slideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-container img {
    height: 60px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo-container img:hover {
    transform: scale(1.05);
}

.lang-toggle {
    display: flex;
    background: var(--glass-bg);
    padding: 4px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    color: var(--text-primary);
}

.lang-btn.active {
    background: var(--accent-color);
    color: white;
}

/* Main Content Container */
.container {
    max-width: 440px; /* Smaller width */
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    padding: 2.5rem 2rem;
    border-radius: 28px;
    width: 100%;
    max-width: 420px; /* Smaller overall size */
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    margin: 0 auto;
}

.main-copy {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    text-align: center;
}

/* Form Styles */
.subscribe-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
    width: 100%;
    padding: 0.8rem 1rem; /* More compact padding */
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.1);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.checkbox-group label {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    cursor: pointer;
}

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

.captcha-group {
    display: flex;
    justify-content: center;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.submit-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 59, 48, 0.25);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

/* Minimal Back Link */
.back-link-container {
    margin-top: 2rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
}

.minimal-back-link {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.minimal-back-link:hover {
    color: var(--text-primary);
    opacity: 1;
}

/* Animations */
@keyframes slideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

/* RTL Support */
body[dir="rtl"] {
    text-align: right;
    font-family: 'Vazirmatn', sans-serif;
}

body[dir="rtl"] .checkbox-group {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

body[dir="rtl"] .lang-toggle {
    flex-direction: row-reverse;
}

body[dir="rtl"] .submit-btn {
    letter-spacing: 0;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 2rem 1.5rem;
        max-width: 340px;
    }
    .header {
        margin-bottom: 2rem;
    }
}

.submit-btn:hover:not(:disabled) {
    background-color: var(--accent-hover);
}

.submit-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Success Popup Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.4s ease;
}

.popup {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    padding: 3.5rem 2.5rem;
    border-radius: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    animation: popupIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.success-icon {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.check-mark {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: drawCheck 0.8s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
    filter: drop-shadow(0 0 8px var(--accent-color));
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

#success-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: white;
    font-weight: 700;
    letter-spacing: -0.02em;
}

#success-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.5;
}

.return-btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: white;
    color: black;
    text-decoration: none;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    border: 1px solid white;
}

.return-btn:hover {
    background: transparent;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hidden {
    display: none !important;
}

/* Success State Updates */
#success-container {
    text-align: center;
    padding: 2rem 0;
}

.success-icon svg {
    filter: drop-shadow(0 0 10px var(--accent-color));
}

#success-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Responsive */
@media (max-width: 600px) {
    .header {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    
    .logo-placeholder {
        position: static;
        transform: none;
    }
    
    .lang-toggle {
        margin: 0;
    }
    
    .page-wrapper {
        padding: 1.5rem;
    }
}

/* Phone Input Styling (intl-tel-input) */
.iti {
    width: 100%;
    margin-bottom: 0.5rem;
}

/* Fix Overlap: Force space for the dial code */
.iti--separate-dial-code .iti__selected-flag {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px 0 0 12px;
    padding: 0 12px !important;
}

.iti--separate-dial-code input[type="tel"] {
    padding-left: 95px !important; /* Large enough to clear the flag and dial code */
}

/* Dark Dropdown Design */
.iti__country-list {
    background: #111 !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8) !important;
    padding: 8px !important;
    margin-top: 8px !important;
}

.iti__country {
    padding: 10px 15px !important;
    border-radius: 8px !important;
    transition: background 0.2s ease;
}

.iti__country:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

.iti__country-name {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.9rem !important;
}

.iti__dial-code {
    color: rgba(255, 255, 255, 0.5) !important;
}

.iti__selected-dial-code {
    color: white !important;
    font-weight: 500;
}

.iti__arrow {
    border-top-color: rgba(255, 255, 255, 0.4) !important;
}

/* Hide the placeholder dial code to avoid double display if needed */
input[type="tel"]::placeholder {
    opacity: 0.3;
}
