
/* Form layout */
.sms-form-wrapper {
    max-width: 600px;
    margin: 50px auto;
    padding: 20px;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* Titles and labels */
.sms-form-wrapper h2 {
    color: #004953;
    margin-bottom: 15px;
}

.sms-form-wrapper p {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Text boxes */
.sms-form-wrapper input[type="text"],
.sms-form-wrapper textarea {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.sms-form-wrapper textarea {
    resize: none;
}


.input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.country-prefix-input {
    flex: 0 0 30%;
    min-width: 80px;
    height: 42px;
    margin-bottom: 0 !important;
}

.recipient-input {
    flex: 1;
    min-width: 120px;
    height: 42px;
    margin-bottom: 0 !important;
}

.sms-message-textarea {
    width: calc(100% - 20px);
}


.instruction {
    font-size: 12px;
    color: #666;
    margin-top: -10px;
    margin-bottom: 15px;
    text-align: left;
}

.instruction.hidden {
    display: none;
}


.sms-mode-toggle {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.sms-mode-toggle input[type="radio"] {
    display: none;
}

.sms-mode-toggle label {
    padding: 10px 20px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sms-mode-toggle input[type="radio"]:checked + label {
    background-color: #004953;
    color: #fff;
}

.saved-contact-trigger-wrap {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-self: center;
}

.saved-contact-toggle {
    width: 34px;
    min-width: 34px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f0f0f0;
    color: #004953;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.saved-contact-toggle:hover {
    background: #e6e6e6;
}

.saved-contact-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(340px, calc(100vw - 48px));
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
    z-index: 30;
    text-align: left;
}

.saved-contact-panel.hidden {
    display: none;
}

.saved-contact-panel .instruction,
.saved-contact-panel .sms-response-message {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    text-align: left;
}

.saved-contact-panel .instruction {
    margin-top: 0;
}

.saved-contact-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #004953;
}

.saved-contact-close {
    border: none;
    background: transparent;
    color: #8b1e1e;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.saved-contact-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.saved-contact-item {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

.saved-contact-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.saved-contact-pick {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
}

.saved-contact-item:not(.active) .saved-contact-pick {
    background: #fff !important;
    border-color: #ddd !important;
    color: #1f1f1f !important;
    box-shadow: none !important;
}

.saved-contact-item:not(.active) .saved-contact-pick:hover,
.saved-contact-item:not(.active) .saved-contact-pick:focus,
.saved-contact-item:not(.active) .saved-contact-pick:focus-visible,
.saved-contact-item:not(.active) .saved-contact-pick:active {
    background: #fff !important;
    border-color: #ddd !important;
    color: #1f1f1f !important;
    box-shadow: none !important;
    outline: none !important;
}

.saved-contact-item.active .saved-contact-pick {
    border-color: #004953 !important;
    background: #eef7f8 !important;
    color: #1f1f1f !important;
    box-shadow: none !important;
}

.saved-contact-item.active .saved-contact-pick:hover,
.saved-contact-item.active .saved-contact-pick:focus,
.saved-contact-item.active .saved-contact-pick:focus-visible,
.saved-contact-item.active .saved-contact-pick:active {
    border-color: #004953 !important;
    background: #eef7f8 !important;
    color: #1f1f1f !important;
    box-shadow: none !important;
    outline: none !important;
}

.saved-contact-name {
    font-weight: 600;
    color: #1f1f1f;
}

.saved-contact-name-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.saved-contact-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 14px;
    padding: 0 5px;
    border-radius: 999px;
    background: #c62828;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
}

.saved-contact-phone {
    color: #666;
    font-size: 12px;
}

.saved-contact-delete {
    flex: 0 0 34px;
    min-width: 34px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    color: #8b1e1e;
    font-size: 18px;
    line-height: 1;
}

.saved-contact-promote {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid #ddd;
    background: #fff3f3;
    border-radius: 4px;
    cursor: pointer;
    color: #b71c1c;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.saved-contact-promote.hidden,
.saved-contact-crisis-confirm.hidden {
    display: none;
}

.saved-contact-save-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
    margin-bottom: 8px;
}

.saved-contact-name-input {
    flex: 1;
    width: auto !important;
    margin-bottom: 0 !important;
}

.saved-contact-phone-input {
    flex: 1;
    width: auto !important;
    margin-bottom: 0 !important;
}

.saved-contact-save-row .secondary-button {
    grid-column: 1 / -1;
    width: 100%;
}

.saved-contact-crisis-confirm {
    margin-bottom: 8px;
    padding: 10px;
    border: 1px solid #ead1d1;
    border-radius: 6px;
    background: #fff8f8;
}

.saved-contact-crisis-text {
    margin-bottom: 8px;
}

.saved-contact-crisis-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: stretch;
}

.saved-contact-activitypass-input {
    width: auto !important;
    margin-bottom: 0 !important;
}

.secondary-button {
    padding: 10px 12px;
    background-color: #f0f0f0;
    color: #004953;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.secondary-button:hover {
    background-color: #e6e6e6;
}

.saved-contact-instruction {
    margin-bottom: 8px;
}

.manual-signature-toggle {
    margin-top: 8px;
    margin-bottom: 12px;
    text-align: left;
}

.manual-signature-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1f1f1f;
    font-size: 14px;
    cursor: pointer;
}

.manual-signature-label input[type="checkbox"] {
    margin: 0;
}

/* Send buttons */
.button-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.button-group button {
    padding: 10px 20px;
    background-color: #004953;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.button-group button:hover {
    background-color: #003f42;
}

/* Response message */
.sms-response-message {
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 80%;
    color: #000;
}

.sms-response-message.success {
    color: #178f4f !important;
}

.sms-response-message.error {
    color: #b00020 !important;
}

.sms-response-message.sending {
    color: #111 !important;
}

.standalone-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #555;
}

.standalone-footer p {
    margin: 6px 0;
}

.footer-secondary-link {
    margin: 6px 0 0;
}

.privacy-footer-link {
    color: #004953;
    text-decoration: none;
    font-weight: 600;
}

.privacy-footer-link:hover,
.privacy-footer-link:focus {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .saved-contact-panel {
        right: -8px;
        width: min(320px, calc(100vw - 32px));
    }

    .saved-contact-pick {
        flex-direction: column;
        align-items: flex-start;
    }

    .saved-contact-save-row {
        flex-direction: column;
        align-items: stretch;
    }

    .saved-contact-crisis-row {
        grid-template-columns: 1fr;
    }

    .secondary-button {
        width: 100%;
    }
}
