@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
    --primary-color: #0c8277;
    --background-color: #f0f4f8;
    --surface-color: #ffffff;
    --text-color: #333;
    --light-text-color: #777;
    --border-color: #e5e7eb;
    --digit-pad-bg: #f3f4f6;
    --digit-pad-hover: #e5e7eb;
    --container-width: 340px;
    --container-min-height: 500px;
}

body { 
    font-family: 'Inter', -apple-system, sans-serif; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    margin: 0; 
    background-color: var(--background-color);
    padding: 1rem;
    box-sizing: border-box;
}

.auth-container { 
    background: var(--surface-color); 
    padding: clamp(20px, 5vw, 40px);
    border-radius: 16px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.07); 
    width: 100%;
    max-width: var(--container-width);
    overflow: hidden;
    position: relative;
    min-height: var(--container-min-height);
    display: flex;
    flex-direction: column;
}

.auth-steps-wrapper {
    position: relative;
    flex-grow: 1;
}

.auth-step {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 10px; /* Padding for content inside */
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center contents vertically */
}

.auth-step:not(.active) {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

.auth-step.exiting {
    transform: translateX(-100%);
}

.auth-step.active {
    transform: translateX(0);
    opacity: 1;
}

h2 { 
    margin-top: 0; 
    margin-bottom: clamp(1rem, 5vh, 2rem);
    color: var(--text-color);
    font-weight: 600;
    text-align: center;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
}

.phone-input, .pin-input { 
    width: 100%; 
    padding: 12px; 
    margin-bottom: clamp(0.5rem, 2vh, 10px); 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    font-size: clamp(1.2rem, 4vw, 1.5em); 
    text-align: center; 
    letter-spacing: 5px; 
    box-sizing: border-box; 
    background-color: #fafafa;
    padding-right: 45px; /* Make space for toggle */
}

.pin-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.pin-toggle {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--light-text-color);
    font-size: 1.2rem;
    line-height: 1;
}

.digit-pad { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px;
    margin-top: clamp(1rem, 3vh, 20px); /* Adjusted to control spacing */
}

.digit-pad button { 
    padding: clamp(12px, 3vh, 20px); 
    font-size: clamp(1.2rem, 4vw, 1.5em); 
    border: none; 
    background: var(--digit-pad-bg); 
    border-radius: 8px; 
    cursor: pointer; 
    transition: background-color 0.2s; 
}

.digit-pad button:hover { background-color: var(--digit-pad-hover); }
.digit-pad .action-btn { background-color: transparent; }

.loader { 
    border: 4px solid var(--digit-pad-hover); 
    border-top: 4px solid var(--primary-color); 
    border-radius: 50%; 
    width: 30px; 
    height: 30px; 
    animation: spin 1s linear infinite; 
    margin: 20px auto; 
    display: none;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- Toast Notification --- */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: #323232;
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 10000;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -1rem);
}

.floating-install-btn {
    position: fixed;
    right: 2rem;
    bottom: 2.5rem;
    z-index: 10001;
    background: #0c8277;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    box-shadow: 0 4px 16px rgba(12,130,119,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    outline: none;
}
.floating-install-btn:hover, .floating-install-btn:focus {
    background: #0a6d62;
    box-shadow: 0 6px 20px rgba(12,130,119,0.28);
    transform: translateY(-2px) scale(1.05);
}
.floating-install-btn svg {
    display: block;
    margin: 0 auto;
}
@media (max-width: 600px) {
    .floating-install-btn {
        right: 1rem;
        bottom: 1.2rem;
        width: 48px;
        height: 48px;
    }
    .floating-install-btn svg {
        width: 22px;
        height: 22px;
    }
}

.install-modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35);
    z-index: 10010;
}
.install-modal-content {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    z-index: 10011;
    min-width: 300px;
    max-width: 90vw;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.install-modal-content h2 {
    margin-top: 0;
    color: #0c8277;
    font-size: 1.3rem;
    font-weight: 600;
}
.install-modal-content ul {
    text-align: left;
    margin: 1rem 0 0 0;
    padding: 0 0 0 1.2em;
}
.install-modal-content li {
    margin-bottom: 0.5em;
    font-size: 1rem;
}
.install-modal-close {
    position: absolute;
    top: 0.7em;
    right: 1em;
    background: none;
    border: none;
    font-size: 1.5em;
    color: #888;
    cursor: pointer;
    z-index: 10012;
}
#install-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10010;
    align-items: center;
    justify-content: center;
} 