:root {
    --primary-bg: #0056b3;
    --primary-border: #004494;
    --primary-bg-hover: #004494;
    --primary-border-hover: #003366;
    --secondary-bg: #ffffff;
    --secondary-border: #ddd;
    --secondary-bg-hover: #e5e5e5;
    --secondary-border-hover: #ccc;
    /* High contrast blue */
    --bg-grey: #f4f7f6;
    --text-dark: #222;
    --success-green: #1e4620;
    /* Accessible dark green */
}

html,
body {
    overflow: hidden;
    height: 100%;
    /* Ensures the body takes the full viewport height */
    margin: 0;
    /* Removes default margins */
    padding: 0;
}


body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-grey);
    background-image: repeating-linear-gradient(45deg,
            transparent,
            transparent 10px,
            rgba(150, 150, 150, 0.03) 10px,
            rgba(150, 150, 150, 0.03) 20px);
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 500;
    line-height: 1.2;
}

h1 {
    font-size: calc(1.375rem + 1.5vw);
}

h2 {
    font-size: calc(1.325rem + .9vw);
}

h3 {
    font-size: calc(1.3rem + .6vw);
}

h4 {
    font-size: calc(1.25rem + .3vw);
}

h5 {
    font-size: calc(1rem + .1vw);
}

h6 {
    font-size: 0.875rem;
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 90%;
    max-width: 400px;
    gap: 20px;
    height: 100%;
}

.container>.shrinker {
    flex-shrink: 0;
}

.container>.expander,
.container>*>.expander {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    align-items: center;
}


.avatar {
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#contactForm {
    gap: 15px;
    /* shadow: */
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    /*padding: 20px;*/
    background: white;
    border-radius: 12px;
    /*box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);*/
}

#contactForm>.actions {
    display: flex;
    flex-direction: row;
    gap: 15px;
    height: 3em;
}

#contactForm>.actions .btn {
    flex: 1;
    justify-content: center;
    height: 100%;
    font-size: 1.2rem;
}

.modalSubtitle {
    font-size: 0.9rem;
    color: #666;
}

.modalBottomText {
    font-size: 0.8rem;
    color: #666;
    text-align: center !important;
}

.links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
}

.btn {
    display: inline-flex;
    /* This allows the gap property to work */
    align-items: center;
    /* Vertically centers the icon with the text */
    justify-content: center;
    gap: 12px;
    /* This creates the margin you're missing */
    height: 3.5rem;
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease;
    width: 100%;
    justify-content: flex-start;
    box-sizing: border-box;
}

.btn svg {
    flex-shrink: 0;
    /* Prevents the icon from getting squashed */
    display: block;
    /* Removes any weird baseline text spacing */
}


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

.primary {
    background: var(--primary-bg);
    border: 1px solid var(--primary-border);
    color: white;
}

/* direct and non-direct path/svg children should */

.primary>svg {
    fill: #fff;
}

.primary:active>svg {
    fill: #000;
}

.primary:hover {
    background: var(--primary-bg-hover);
    border: 1px solid var(--primary-border-hover);
    color: white;
}

.secondary {
    background: var(--secondary-bg);
    border: 1px solid var(--secondary-border);
    color: var(--text-dark);
}

.secondary:hover {
    background: var(--secondary-bg-hover);
    border: 1px solid var(--secondary-border-hover);
    color: var(--text-dark);
}

.text {
    background: transparent;
    color: #666;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-content {
    background: white;
    margin: 0 1rem;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.24s ease, transform 0.24s ease;
    will-change: opacity, transform;
}

.modal-overlay[aria-hidden="true"] .modal-content {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    border: 0;
    background: transparent;
    color: #666;
    padding: 6px;
    line-height: 0;
    cursor: pointer;
}

.modal-close:hover {
    color: #111;
}

.field {
    margin-bottom: 15px;
    text-align: left;
}

label {
    display: flex;
    gap: 4px;
    font-size: 0.8rem;
    margin-bottom: 5px;
    align-items: center;
    /*font-weight: bold;*/
}

textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group-text {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    color: #6c757d;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-right: 0;
    border-radius: 8px 0 0 8px;
    font-weight: 500;
    flex-shrink: 0;
}

.form-control {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.input-group .form-control {
    border-left: 1px solid #ddd;
    border-radius: 0 8px 8px 0;
    margin-left: -1px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-bg);
}

.input-group .input-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    color: #6c757d;
    border-right: 1px solid #ccc;
    background: #f8f9fa;
}

.message-field {
    resize: none;
    line-height: 1.4;
    min-height: calc(1.4em + 20px);
    max-height: calc(1.4em * 3 + 20px);
    overflow-y: hidden;
}

.message-field.is-expanded {
    overflow-y: auto;
}

@media (min-width: 519px) {
    .mobile-only {
        display: none !important;
        height: 0 !important;
    }
}

@media (max-width: 520px) {
    .links {
        grid-template-columns: 1fr;
    }

    .desktop-only {
        display: none !important;
        height: 0 !important;
    }
}

.hidden {
    display: none !important;
}

.modal-status-box {
    display: flex;
    gap: 15px;
    color: white;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    margin-top: 15px;
}

/* Success Box */
.success-box {
    flex-direction: column;
    background-color: var(--success-green);

}

.sending-box {
    flex-direction: row;
    background-color: var(--success-green);
}

.error-box {
    flex-direction: column;
    background-color: #b00020;
}

#statusMessage {
    display: flex;
    flex-direction: column;
}

#statusMessage>* {
    max-height: 0;
    opacity: 0;
    transform: scale(0.5);
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.28s ease, opacity 0.2s ease, transform 0.24s ease;
}

#statusMessage[selection="ready"]>.modal-status-ready,
#statusMessage[selection="ready"]>.modal-contact-form,
#statusMessage[selection="sending"]>.modal-status-sending,
#statusMessage[selection="success"]>.modal-status-success,
#statusMessage[selection="error"]>.modal-status-error,
#statusMessage[selection="error"]>.modal-contact-form {
    display: block;
    max-height: 1200px;
    opacity: 1;
    /*transform: translateY(0);*/
    transform: scale(1);
    pointer-events: auto;
}

#statusMessage[selection="ready"]>.modal-contact-form,
#statusMessage[selection="error"]>.modal-contact-form {
    margin-top: 0px;
}

.btn-label-container {
    display: flex;
    position: relative;
    /* This allows the labels to stack on top of each other */
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.btn-label-container>* {
    display: flex;
    position: absolute;
    align-items: center;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.btn-label-container[selection="share"] .btn-label-share,
.btn-label-container[selection="copied"] .btn-label-copied,
.btn-label-container[selection="opening"] .btn-label-opening {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0s linear 0s;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}