:root {
    --primary-burgundy: #8b0015;
    --primary-gradient: linear-gradient(90deg, #7a0010 0%, #a30018 100%);
    --text-dark: #111827;
    --text-muted: #4b5563;
    --input-bg: #f3f4f6;
    --focus-shadow: 0 4px 12px rgba(139, 0, 21, 0.08);
    --error-red: #df2222;
    --success-green: #10b981;
    --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    width: 100%;
    height: 100dvh;
    overflow: hidden; 
    background-color: #f8f9fa;
    position: relative;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
}

.bg-wave {
    position: absolute;
    left: 0;
    width: 100%;
    z-index: 0;
    pointer-events: none;
}
.bg-wave-top {
    top: 0;
    height: 12vh;
    min-height: 80px;
}
.bg-wave-bottom {
    bottom: 0;
    height: 10vh;
    min-height: 70px;
}

.back-btn {
    position: absolute;
    top: calc(20px + env(safe-area-inset-top));
    left: 20px;
    color: #ffffff;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background 0.2s ease;
}

.back-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

.app-view {
    width: 100%;
    height: 100dvh;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(8vh + env(safe-area-inset-top)) 24px calc(8vh + env(safe-area-inset-bottom)) 24px;
    position: relative;
    z-index: 1;
    overflow-y: auto;
}

.header-content {
    text-align: center;
    margin-bottom: 2vh;
}

.header-content h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
    letter-spacing: -0.03em;
}

.header-content p {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 2.5vh;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dark);
}

.step-dot-active {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-burgundy);
    border: 2.5px solid #ffccd5;
    transition: all 0.3s ease;
}

.step-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #d1d5db;
    transition: all 0.3s ease;
}

.registration-form, .verification-view {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.verification-view {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

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

.input-group {
    position: relative;
    width: 100%;
}

.input-box {
    width: 100%;
    height: 52px;
    background-color: var(--input-bg);
    border: 1.5px solid transparent;
    border-radius: 14px;
    padding: 0 45px 0 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    outline: none;
    transition: all 0.2s ease;
}

.input-box:focus {
    border-color: var(--primary-burgundy);
    background-color: #ffffff;
    box-shadow: var(--focus-shadow);
}

.field-label {
    position: absolute;
    top: -9px;
    left: 14px;
    background-color: #f8f9fa;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dark);
    z-index: 2;
}

.label-required {
    color: var(--primary-burgundy);
    font-weight: 700;
}

.phone-input-wrapper {
    display: flex;
    align-items: center;
}

.country-trigger {
    position: absolute;
    left: 14px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    height: 100%;
    padding-right: 8px;
    border-right: 1.5px solid #e5e7eb;
}

.trigger-flag {
    font-size: 18px;
    line-height: 1;
}

.trigger-code {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
}

.trigger-arrow {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
}

.input-box.phone-indent {
    padding-left: 105px; 
}

/* OTP Code Area */
.otp-container {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 15px 0;
}

.otp-input {
    width: 48px;
    height: 56px;
    background-color: var(--input-bg);
    border: 2px solid transparent;
    border-radius: 12px;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-dark);
    outline: none;
    transition: all 0.2s ease;
}

.otp-input:focus {
    border-color: var(--primary-burgundy);
    background-color: #ffffff;
    box-shadow: var(--focus-shadow);
}

.resend-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 10px;
    font-weight: 500;
}

.resend-link {
    color: var(--primary-burgundy);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.resend-link.disabled {
    color: #9ca3af;
    cursor: not-allowed;
    font-weight: 500;
}

.country-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.country-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.country-modal {
    width: 90%;
    max-width: 360px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9); 
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 70vh;
}

.country-modal-overlay.active .country-modal {
    transform: scale(0.95); 
}

.modal-search-wrapper {
    padding: 14px;
    border-bottom: 1px solid #f3f4f6;
    background: #ffffff;
}

.modal-search {
    width: 100%;
    height: 40px;
    background: #f3f4f6;
    border: 1.5px solid transparent;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 600;
    outline: none;
}

.modal-search:focus {
    border-color: var(--primary-burgundy);
    background: #ffffff;
}

.country-list-scroll {
    overflow-y: auto;
    flex: 1;
    padding: 6px 0;
}

.country-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    gap: 12px;
}

.country-item:active, .country-item:hover {
    background: #f9fafb;
}

.item-flag {
    font-size: 20px;
}

.item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-code {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
}

.input-helper-text {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    padding-left: 4px;
    font-weight: 500;
}

.input-icon-right {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.form-action-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 5px;
    padding-bottom: 28px;
}

.btn-submit {
    width: 100%;
    height: 54px;
    background: var(--primary-gradient);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(139, 0, 21, 0.15);
    transition: transform 0.1s ease, opacity 0.2s ease;
    letter-spacing: -0.01em;
}

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

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-redirect-footer {
    position: fixed;
    bottom: calc(4vh + env(safe-area-inset-bottom));
    left: 0;
    width: 100%;
    font-size: 12px;
    color: #ffffff;
    text-align: center;
    font-weight: 600;
    z-index: 10;
}

.login-redirect-footer a {
    color: #ffffff;
    font-weight: 800;
    text-decoration: underline;
}

.toast-container {
    position: fixed;
    top: calc(20px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    background: rgba(17, 24, 39, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    z-index: 9999;
    display: none;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    width: 85%;
    max-width: 360px;
}

@media (max-height: 650px) {
    .app-view { padding-top: 60px; padding-bottom: 40px; }
    .header-content h1 { font-size: 22px; }
    .btn-submit { height: 50px; }
    .step-indicator { margin-bottom: 1.5vh; }
}


