/* 1. Base Styles (Mobile First) */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* 2. Main Card Container */
.container {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    width: 90%;
    max-width: 400px; /* Simulates a phone screen width */
    padding: 30px 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
    border-radius: 25px;
    margin: 20px auto;
    box-sizing: border-box;
}

/* 3. Profile Image */
.profile-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 25px;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(211, 47, 47, 0); }
    100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); }
}

/* 4. Text Styles */
h1 {
    font-size: 26px;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

p {
    color: #7f8c8d;
    margin-top: 0;
    margin-bottom: 35px;
    font-size: 16px;
    line-height: 1.5;
}

/* 5. The "Hero" Button (Share Location) */
.btn-location {
    background: linear-gradient(45deg, #d32f2f, #ff5252);
    color: white;
    border: none;
    padding: 18px 25px;
    width: 100%;
    font-size: 16px;
    font-weight: 700;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(211, 47, 47, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-location:active {
    transform: scale(0.96);
    box-shadow: 0 5px 10px rgba(211, 47, 47, 0.2);
}

/* 6. Secondary Buttons (Contact/Medical) */
.btn-secondary {
    background-color: white;
    color: #555;
    border: 1px solid #e0e0e0;
    padding: 16px;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    border-radius: 15px;
    cursor: pointer;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none; /* For phone links */
    box-sizing: border-box; /* Ensures padding doesn't break width */
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #f9f9f9;
    border-color: #ccc;
}

/* 7. The "Success" Popup (Hidden by default) */
.success-message {
    display: none; /* Hidden initially */
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #c8e6c9;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hidden form for GPS background submission */
#gpsForm {
    display: none;
}

/* 8. Manual Fallback */
.manual-fallback {
    margin-top: 20px;
    text-align: left;
}

.input-field {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
}

/* Footer styling */
.footer {
    margin-top: 30px;
    font-size: 12px;
    color: #999;
}

.contact-details {
    text-align: left;
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 15px;
    font-size: 14px;
}
.contact-details strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

/* 9. Map Preview */
.map-container {
    display: none;
    width: 100%;
    height: 200px;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}

/* 10. Activation Form */
.activation-box {
    display: none;
    text-align: left;
    animation: fadeIn 0.5s;
}

/* 11. Modal Styles */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5); z-index: 1000;
    justify-content: center; align-items: center; backdrop-filter: blur(2px);
}
.modal-card {
    background-color: white; width: 85%; max-width: 320px;
    border-radius: 20px; padding: 25px; text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: popIn 0.3s ease-out;
}
@keyframes popIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* Locked State */
.locked-blur { filter: blur(5px); pointer-events: none; user-select: none; }
.lock-overlay {
    margin: 20px 0; padding: 20px; background: #fff3e0; border: 1px solid #ffe0b2;
    border-radius: 10px; color: #e65100; font-size: 14px;
}
.char-count { font-size: 11px; color: #999; text-align: right; margin-top: -8px; margin-bottom: 8px; margin-right: 5px; }