/*@import url('https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&display=swap');*/

/* Persian Font integration */
@font-face {
    font-family: "Vazirmatn";
    src: url("fonts/Vazirmatn-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("fonts/Vazirmatn-Medium.ttf") format("truetype");
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("fonts/Vazirmatn-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

:root {
    --primary-color: #00897b;
    --primary-hover: #00695c;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-main: #2c3e50;
    --text-muted: #607d8b;
    --border-color: #cfd8dc;
    --error-color: #e53935;
    --error-bg: #ffebee;
    --success-color: #43a047;
    --success-bg: #e8f5e9;
    --focus-ring: rgba(0, 137, 123, 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    /* Vazirmatn added as the primary font for Farsi support */
    font-family: "Vazirmatn", system-ui, -apple-system, sans-serif,
    "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji";
    background: linear-gradient(135deg, #43cea2 0%, #185a9d 100%);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.signup-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

.signup-card {
    background: var(--card-bg);
    padding: 1.8rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 600px;
    backdrop-filter: blur(10px);
}

h1 {
    color: var(--primary-color);
    font-size: 1.7rem;
    margin-bottom: 0.2rem;
    font-weight: 800;
    text-align: center;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
    text-align: center;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-group {
    margin-bottom: 0.8rem;
    flex: 1;
    position: relative;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-main);
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.7rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
    background-color: #f8fafc;
    font-family: inherit;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

input.input-error {
    border-color: var(--error-color);
    background-color: var(--error-bg);
}

.error-hint {
    color: var(--error-color);
    font-size: 0.75rem;
    margin-top: 0.2rem;
    min-height: 1.1em;
    display: block;
}

.pwd-input-wrap { position: relative; }

.pwd-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.pwd-toggle:hover { color: var(--text-main); }

/* Custom Select (Country) */
.custom-select { position: relative; }
.select-trigger {
    padding: 0.7rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    transition: all 0.2s;
}

.select-trigger.input-error { border-color: var(--error-color); background-color: var(--error-bg); }
.select-trigger:focus, .select-trigger:focus-within {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.options-container {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    margin-top: 5px;
    z-index: 10;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.options-container.active { display: block; }

#countrySearch {
    width: 92%;
    margin: 8px 4%;
    padding: 0.5rem;
    border-radius: 6px;
    font-family: inherit;
}

#countryList {
    max-height: 200px;
    overflow-y: auto;
    list-style: none;
}

#countryList li {
    padding: 0.6rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

#countryList li:hover, #countryList li.highlighted {
    background: #e0f2f1;
    color: var(--primary-color);
    font-weight: bold;
}

/* Updated emoji font stack to support Windows flags via Noto Color Emoji */
.emoji-flag {
    font-family: "Noto Color Emoji", "Twemoji Country Flags", "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
    font-size: 1.2rem;
}

/* Checkbox & Button */
.checkbox-group { display: flex; flex-direction: column; margin-bottom: 0.5rem; }
.checkbox-wrapper { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem; border-radius: 4px; transition: all 0.2s; }
.checkbox-wrapper input { width: 1.1rem; height: 1.1rem; cursor: pointer; accent-color: var(--primary-color); }
.checkbox-wrapper a { color: var(--primary-color); text-decoration: none; font-weight: bold; }
.checkbox-wrapper a:hover { text-decoration: underline; }

/* Styles for invalid checkbox */
.checkbox-wrapper.input-error {
    background-color: var(--error-bg);
    color: var(--error-color);
    outline: 1px solid var(--error-color);
}

.checkbox-wrapper.input-error a { color: var(--error-color); text-decoration: underline; }

.btn-primary {
    width: 100%;
    padding: 0.9rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 0.5rem;
    font-family: inherit;
}

.btn-primary.btn-disabled {
    background: #90a4ae;
}

.btn-primary:not(.btn-disabled):hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(0, 137, 123, 0.4);
}

/* Alerts */
.alert {
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.alert.error {
    background: var(--error-bg);
    color: var(--error-color);
    border: 1px solid #f5c6cb;
    display: block;
}

.alert.success {
    background: var(--success-bg);
    color: var(--success-color);
    border: 1px solid #c3e6cb;
    display: block;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.active { display: flex; }

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
    line-height: 1.6;
}

.close-btn {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-muted);
}

.close-btn:hover { color: var(--text-main); }

/* Responsive */
@media (max-width: 540px) {
    .signup-card {
        padding: 1.5rem 1.25rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .btn-primary {
        font-size: 0.95rem;
        padding: 0.75rem;
    }
}