:root {
    --primary-blue: #2563eb;
    --primary-blue-hover: #1d4ed8;
    --bg-gradient: linear-gradient(to right, #93f9b9, #1d976c);
    --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    --input-bg: #eeeeee;
    --text-color: #333333;
    --text-muted: #4b5563;
    --border-color: #e2e8f0;
}

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

body {
    background: var(--bg-gradient);
    background-size: 200% auto;
    animation: gradient-shift 12s ease infinite;
    font-family: 'Poppins', 'Noto Sans Sinhala', sans-serif;
    color: var(--text-color);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1rem;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.landing-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    width: 100%;
    max-width: 820px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    min-height: 480px;
    align-items: center;
}

/* Left Column: Mockup */
.mockup-column {
    background: #f7fafc;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-right: 1px solid var(--border-color);
}

.mockup-wrapper {
    width: 210px;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 800px;
}

.phone-mockup {
    background: #000000;
    width: 100%;
    height: 100%;
    border-radius: 30px;
    border: 8px solid #1a202c;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: rotateY(-15deg) rotateX(8deg) rotateZ(1deg);
    box-shadow: -15px 20px 35px rgba(0, 0, 0, 0.35);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.phone-mockup:hover {
    transform: rotateY(-5deg) rotateX(3deg) rotateZ(0deg);
    box-shadow: -8px 12px 20px rgba(0, 0, 0, 0.25);
}

.phone-notch {
    width: 100px;
    height: 12px;
    background: #1a202c;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    z-index: 10;
}

.phone-screen {
    background: #0f1115;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    padding-top: 14px;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
}

.phone-status-bar {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    padding: 0 4px;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.status-icons {
    display: flex;
    gap: 4px;
}

.phone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    margin-bottom: 25px;
    color: rgba(255, 255, 255, 0.9);
}

.back-arrow {
    font-weight: bold;
    color: #60a5fa;
    font-size: 0.9rem;
    cursor: pointer;
}

.edit-link {
    color: #60a5fa;
    cursor: pointer;
}

.phone-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    background: #ffffff;
    border-radius: 50%;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    font-family: 'Noto Sans Sinhala', sans-serif;
}

.profile-name {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.online-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #48bb78;
    border-radius: 50%;
    position: relative;
}

.online-indicator::after {
    content: '';
    width: 100%;
    height: 100%;
    background: #48bb78;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
    animation: online-pulse 1.8s infinite ease-in-out;
}

@keyframes online-pulse {
    0% {
        transform: scale(1);
        opacity: 0.85;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

.profile-sub {
    font-size: 0.6rem;
    color: #a0aec0;
}

.phone-actions {
    display: flex;
    justify-content: space-around;
    margin-bottom: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 0;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.action-icon {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.action-label {
    font-size: 0.55rem;
    color: #a0aec0;
}

.phone-footer {
    margin-top: auto;
    text-align: center;
    padding-bottom: 5px;
}

.add-notes-btn {
    font-size: 0.65rem;
    color: #4ade80;
    text-decoration: none;
    font-weight: 600;
}

/* Right Column: Form */
.form-column {
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sinhala-heading {
    font-family: 'Noto Sans Sinhala', sans-serif;
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.6;
    margin-bottom: 2rem;
    text-align: center;
    color: #2d3748;
}

.sinhala-heading strong {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
}

.input-container {
    background: var(--input-bg);
    border-radius: 50px;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    height: 48px;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                background-color 0.3s ease,
                border-color 0.3s ease;
}

.input-container:focus-within {
    border-color: rgba(37, 99, 235, 0.4);
    background: #ffffff;
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
}

.input-icon {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
}

.input-field {
    border: none;
    background: transparent;
    flex: 1;
    min-width: 0; /* let the box shrink on narrow phones instead of pushing the page sideways */
    width: 100%;
    height: 100%;
    font-size: 1rem;
    color: var(--text-color);
    outline: none;
    font-family: 'Poppins', sans-serif;
}

.btn-blue {
    background: var(--primary-blue);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    width: 100%;
    height: 48px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Poppins', sans-serif;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1),
                background-color 0.2s ease,
                box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-blue:hover {
    background: var(--primary-blue-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.btn-blue:active {
    transform: translateY(1px) scale(0.97);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.btn-blue:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    width: 100%;
    height: 48px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Poppins', sans-serif;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1),
                background-color 0.2s ease,
                color 0.2s ease,
                box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: #ffffff;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-outline:active {
    transform: translateY(1px) scale(0.97);
}


.pricing-notice {
    font-size: 0.7rem;
    color: var(--price-color, #acacac);
    text-align: center;
    margin-top: 1.25rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

.alert {
    border-radius: 12px;
    padding: 1rem 1.1rem;
    font-size: 1.05rem; /* readable for older users */
    margin-bottom: 1.25rem;
    display: none;
    line-height: 1.4;
    text-align: left;
    font-family: 'Noto Sans Sinhala', 'Poppins', sans-serif;
    font-weight: 500;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(46, 213, 115, 0.08);
    border: 1px solid rgba(46, 213, 115, 0.25);
    color: #15803d;
}

.alert-info {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.25);
    color: #1d4ed8;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #b91c1c;
}

/* RESPONSIVE LAYOUT (Mobile First / No Scroll) */
@media (max-width: 767px) {
    body {
        padding: 0;
        align-items: center;
        justify-content: center;
        overflow-x: hidden;
        overflow-y: auto; /* never cut content off on short screens */
    }

    .alert {
        width: 100%;
        max-width: 320px;
    }

    .otp-mode .mockup-wrapper {
        display: none;
    }
    
    .landing-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-radius: 0;
        min-height: 100vh;
        min-height: 100dvh;
        box-shadow: none;
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .mockup-column {
        display: contents; /* Strip column wrapping on mobile */
    }
    
    .mockup-wrapper {
        width: 140px;
        height: 225px;
        perspective: 500px;
        margin: 0 auto 2.25rem auto;
    }
    
    .phone-mockup {
        border-width: 5px;
        border-radius: 20px;
        transform: rotateY(-15deg) rotateX(8deg) rotateZ(1deg);
        box-shadow: -10px 15px 25px rgba(0, 0, 0, 0.35);
    }
    
    .phone-notch {
        width: 60px;
        height: 8px;
        border-bottom-left-radius: 6px;
        border-bottom-right-radius: 6px;
    }
    
    .phone-screen {
        padding: 6px;
        padding-top: 10px;
    }
    
    .phone-status-bar {
        font-size: 0.5rem;
        margin-bottom: 6px;
    }
    
    .phone-header {
        font-size: 0.55rem;
        margin-bottom: 8px;
    }
    
    .phone-profile {
        margin-bottom: 10px;
    }
    
    .profile-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.85rem;
        margin-bottom: 4px;
    }
    
    .profile-name {
        font-size: 0.6rem;
    }
    
    .profile-sub {
        font-size: 0.45rem;
    }
    
    .phone-actions {
        padding: 4px 0;
        margin-bottom: 8px;
    }
    
    .action-icon {
        font-size: 0.65rem;
        margin-bottom: 2px;
    }
    
    .action-label {
        font-size: 0.45rem;
    }
    
    .add-notes-btn {
        font-size: 0.5rem;
    }
    
    .form-column {
        display: contents; /* Strip column wrapping on mobile */
    }
    
    #otp-request-form,
    #otp-verify-form {
        width: 100%;
        max-width: 320px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
    
    .sinhala-heading {
        font-size: 1.2rem;
        margin-top: 0.5rem;
        margin-bottom: 1.25rem;
        line-height: 1.5;
    }
    
    .input-container {
        margin-bottom: 1rem;
    }
    
    .pricing-notice {
        margin-top: 1rem;
    }
}

#otp-request-form,
#otp-verify-form {
    width: 100%;
    animation: form-fade-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Custom Cursor Dot & Ring with Dynamic Contrast */
.custom-cursor-dot {
    display: none;
    position: fixed;
    width: 6px;
    height: 6px;
    background-color: #ffffff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999999;
    transform: translate(-50%, -50%);
    transition: width 0.15s ease, height 0.15s ease, background-color 0.25s ease;
}

.custom-cursor-ring {
    display: none;
    position: fixed;
    width: 26px;
    height: 26px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999998;
    transform: translate(-50%, -50%);
    transition: width 0.2s cubic-bezier(0.25, 1, 0.5, 1), 
                height 0.2s cubic-bezier(0.25, 1, 0.5, 1),
                border-color 0.25s ease,
                background-color 0.2s ease;
}

/* Dark theme triggers when over the white card */
.custom-cursor-dot.dark-cursor {
    background-color: #2d3748;
}

.custom-cursor-ring.dark-cursor {
    border-color: #2d3748;
}

/* I-beam text select cursor for input fields (FontAwesome icon) */
.custom-cursor-dot.text-hover {
    width: auto !important;
    height: auto !important;
    background-color: transparent !important;
    color: #ffffff !important;
    font-size: 13px !important;
    line-height: 1 !important;
    border-radius: 0 !important;
}
.custom-cursor-dot.text-hover.dark-cursor {
    color: #2d3748 !important;
}
.custom-cursor-ring.text-hover {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

/* Hover States */
/* 1. Default (White on Dark / Colored) */
.custom-cursor-dot.hover {
    width: 8px;
    height: 8px;
    background-color: #ffffff !important;
}

.custom-cursor-ring.hover {
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: #ffffff !important;
}

/* 2. Dark Hover (Dark on Light backgrounds, like links on the white card) */
.custom-cursor-dot.hover.dark-hover {
    background-color: #2d3748 !important;
}

.custom-cursor-ring.hover.dark-hover {
    background-color: rgba(45, 55, 72, 0.08) !important;
    border-color: #2d3748 !important;
}

/* OTP step: large, plain and high-contrast for older users */
.otp-step .sinhala-heading {
    font-size: 1.45rem;
    line-height: 1.55;
    color: #1a202c;
    margin-bottom: 2.25rem;
}

.otp-step .input-container {
    height: 64px;
    margin-bottom: 1.75rem;
}

.otp-step .input-container:focus-within {
    transform: none;
    border-color: #5cb85c;
    box-shadow: 0 0 0 3px rgba(92, 184, 92, 0.25);
}

.otp-step .input-icon {
    font-size: 1.3rem;
}

.otp-step .input-field {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.15em;
}

.otp-step .input-field::placeholder {
    color: #a0a0a0;
}

.btn-green {
    background: var(--otp-button, #5cb85c);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    width: 100%;
    height: 60px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
}

.btn-green:hover {
    filter: brightness(0.92);
}

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

.link-back {
    display: block;
    margin: 1.5rem auto 0;
    background: none;
    border: none;
    color: #4b5563;
    font-size: 1rem;
    font-family: 'Noto Sans Sinhala', sans-serif;
    text-decoration: underline;
    cursor: pointer;
}

/* Shake animation for input validation errors */
.input-error-shake {
    animation: shake 0.4s ease-in-out !important;
    border-color: #f85149 !important;
    box-shadow: 0 0 0 3px rgba(248, 81, 73, 0.2) !important;
    background-color: #fff5f5 !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
