/**
 * GMRR — Floating Download Sample Button
 * Design tokens: navy #1e3a5f · gold #d4a017 · teal #0e9488
 */

/* ══════════════════════════════════════════════════════
   FLOATING BUTTON
══════════════════════════════════════════════════════ */

.gmrr-float-btn-wrap {
    position: fixed;
    left: 0;
    z-index: 99980;
    /* vertical centering handled per modifier below */
}

.gmrr-float-btn-wrap[hidden] {
    display: none !important;
}

/* Vertical position modifiers */
.gmrr-float-btn-wrap--top    { top: 15%; }
.gmrr-float-btn-wrap--middle { top: 50%; transform: translateY(-50%); }
.gmrr-float-btn-wrap--bottom { bottom: 15%; }

/* ── Slide-in from left on appear ── */
.gmrr-float-btn-wrap--visible {
    animation: gmrr-float-slide-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes gmrr-float-slide-in {
    from { transform: translateX(-100%); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}

/* Override transform for middle position so animation works */
.gmrr-float-btn-wrap--middle.gmrr-float-btn-wrap--visible {
    animation: gmrr-float-slide-in-middle 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes gmrr-float-slide-in-middle {
    from { transform: translateY(-50%) translateX(-100%); opacity: 0; }
    to   { transform: translateY(-50%) translateX(0);     opacity: 1; }
}

/* ── The button itself ── */
.gmrr-float-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;

    /* Tab shape — wider top + narrow attachment side via border-radius */
    background: linear-gradient(180deg, #1e3a5f 0%, #1e40af 100%);
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    border-left: 4px solid #d4a017;

    /* Rotated label sits inside a fixed-height column */
    padding: 18px 10px;
    cursor: pointer;
    box-shadow: 3px 3px 18px rgba(15, 23, 42, 0.30);
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    min-width: 42px;
}

.gmrr-float-btn:hover {
    background: linear-gradient(180deg, #16325a 0%, #1a38a8 100%);
    box-shadow: 4px 4px 24px rgba(15, 23, 42, 0.42);
    transform: translateX(3px);
}

.gmrr-float-btn:focus-visible {
    outline: 3px solid #d4a017;
    outline-offset: 3px;
}

/* ── Download icon (top of the button) ── */
.gmrr-float-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

.gmrr-float-btn-icon svg {
    display: block;
}

/* ── Rotated label ── */
.gmrr-float-btn-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);   /* bottom-to-top reading direction */
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
}

/* ── Pulse attention animation — fires once on first appear ── */
.gmrr-float-btn-wrap--pulse .gmrr-float-btn {
    animation: gmrr-float-pulse 0.7s ease 2;
}

@keyframes gmrr-float-pulse {
    0%, 100% { box-shadow: 3px 3px 18px rgba(15, 23, 42, 0.30); }
    50%      { box-shadow: 3px 3px 28px rgba(212, 160, 23, 0.60), 0 0 0 4px rgba(212, 160, 23, 0.25); }
}

/* ══════════════════════════════════════════════════════
   MODAL OVERLAY
══════════════════════════════════════════════════════ */

.gmrr-float-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: gmrr-float-overlay-in 0.22s ease forwards;
}

.gmrr-float-modal-overlay[hidden] { display: none !important; }

@keyframes gmrr-float-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal card ── */
.gmrr-float-modal-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
    max-width: 520px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    padding: 34px 34px 28px;
    animation: gmrr-float-card-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    /* Left accent matching the button's gold border */
    border-top: 4px solid #d4a017;
}

@keyframes gmrr-float-card-in {
    from { transform: translateY(20px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* ── Close × ── */
.gmrr-float-modal-x {
    position: absolute;
    top: 13px;
    right: 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #94a3b8;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}
.gmrr-float-modal-x:hover { background: #f1f5f9; color: #334155; }

/* ── Header ── */
.gmrr-float-modal-header { text-align: center; margin-bottom: 16px; }

.gmrr-float-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #e8f0fe 0%, #dbeafe 100%);
    border-radius: 14px;
    margin-bottom: 10px;
    color: #1e40af;
}

.gmrr-float-modal-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1e3a5f;
    margin: 0 0 7px;
    line-height: 1.25;
}

.gmrr-float-modal-subtitle {
    font-size: 0.875rem;
    color: #475569;
    margin: 0;
    line-height: 1.6;
}

/* ── Trust strip ── */
.gmrr-float-modal-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: center;
    margin-bottom: 20px;
}

.gmrr-float-modal-badge {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 11px;
    white-space: nowrap;
}

/* ── Form grid ── */
.gmrr-float-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
    margin-bottom: 12px;
}

.gmrr-float-modal-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gmrr-float-modal-field--full { grid-column: 1 / -1; }

.gmrr-float-modal-field label {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.gmrr-float-req { color: #ef4444; }

.gmrr-float-modal-field input {
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 13.5px;
    color: #1e293b;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.gmrr-float-modal-field input::placeholder { color: #94a3b8; }

.gmrr-float-modal-field input:focus {
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.11);
}

.gmrr-float-modal-field input.gmrr-float-error-input {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.10);
}

/* ── Privacy ── */
.gmrr-float-modal-privacy {
    font-size: 11px;
    color: #94a3b8;
    margin: 0 0 15px;
    text-align: center;
    line-height: 1.5;
}
.gmrr-float-modal-privacy a { color: #1e40af; text-decoration: underline; }

/* ── Submit button ── */
.gmrr-float-modal-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(30, 58, 95, 0.32);
    transition: opacity 0.2s, transform 0.15s;
}
.gmrr-float-modal-submit:hover  { opacity: 0.91; transform: translateY(-1px); }
.gmrr-float-modal-submit:active { transform: translateY(0); }
.gmrr-float-modal-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.gmrr-float-modal-spinner svg {
    animation: gmrr-float-spin 0.75s linear infinite;
}
@keyframes gmrr-float-spin { to { transform: rotate(360deg); } }

/* ── Error ── */
.gmrr-float-modal-error {
    margin-top: 11px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 8px;
    padding: 9px 13px;
    font-size: 13px;
    text-align: center;
}
.gmrr-float-modal-error[hidden] { display: none !important; }

/* ── Success ── */
.gmrr-float-modal-success { text-align: center; padding: 14px 0 6px; }
.gmrr-float-modal-success[hidden] { display: none !important; }

.gmrr-float-modal-success-icon { font-size: 2.8rem; margin-bottom: 10px; line-height: 1; }

.gmrr-float-modal-success h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1e3a5f;
    margin: 0 0 7px;
}

.gmrr-float-modal-success p {
    color: #475569;
    font-size: 0.875rem;
    margin: 0 0 18px;
    line-height: 1.6;
}

.gmrr-float-modal-done-btn {
    background: #0e9488;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 26px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}
.gmrr-float-modal-done-btn:hover { opacity: 0.88; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */

/* On very small screens, shrink the button label to avoid overflowing */
@media (max-width: 400px) {
    .gmrr-float-btn-label { font-size: 10px; letter-spacing: 0.03em; }
    .gmrr-float-btn       { padding: 14px 8px; }
    .gmrr-float-btn-icon  { width: 28px; height: 28px; }
}

@media (max-width: 540px) {
    .gmrr-float-modal-card { padding: 26px 18px 22px; border-radius: 12px; }
    .gmrr-float-modal-grid { grid-template-columns: 1fr; }
    .gmrr-float-modal-field--full { grid-column: 1; }
    .gmrr-float-modal-title { font-size: 1.15rem; }
}
