/**
 * GV Auth Modal – Styles
 * Matches the Next.js AuthDialog design.
 */

/* ── Overlay ── */

.gv-am-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding: 16px;
}

.gv-am-overlay--open {
    opacity: 1;
    visibility: visible;
}

/* ── Dialog ── */

.gv-am-dialog {
    position: relative;
    width: 95vw;
    max-width: 520px;
    max-height: 95vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    text-align: center;
    transform: translateY(8px) scale(0.97);
    transition: transform 0.2s ease;
}

.gv-am-overlay--open .gv-am-dialog {
    transform: translateY(0) scale(1);
}

/* ── Close button ── */

.gv-am-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #999;
    transition: background 0.15s, color 0.15s;
    padding: 0;
}

.gv-am-close:hover {
    background: #f5f5f5;
    color: #333;
}

.gv-am-close svg {
    width: 18px;
    height: 18px;
}

/* ── Heart / Check icon ── */

.gv-am-icon-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.gv-am-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fee2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.5s ease, transform 0.5s ease;
}

.gv-am-icon--success {
    background: #dcfce7;
    transform: scale(1.1);
}

.gv-am-heart {
    width: 32px;
    height: 32px;
    color: #ef4444;
    transition: opacity 0.3s;
}

.gv-am-check {
    width: 32px;
    height: 32px;
    color: #22c55e;
    display: none;
}

.gv-am-icon--success .gv-am-heart { display: none; }
.gv-am-icon--success .gv-am-check {
    display: block;
    animation: gv-am-scale-in 0.3s ease;
}

@keyframes gv-am-scale-in {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ── Title / Subtitle ── */

.gv-am-title {
    font-size: 22px;
    font-weight: 600;
    color: #111;
    margin: 0 0 8px;
    line-height: 1.3;
}

.gv-am-subtitle {
    font-size: 15px;
    color: #666;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* ── Success message ── */

.gv-am-success {
    padding: 16px 0;
}

.gv-am-success-text {
    font-size: 15px;
    color: #22c55e;
    font-weight: 500;
    margin: 0;
}

/* ── Google button ── */

.gv-am-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 48px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    transition: background 0.15s, border-color 0.15s;
    padding: 0 16px;
}

.gv-am-google:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #aaa;
}

.gv-am-google:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.gv-am-google-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ── Separator ── */

.gv-am-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: #aaa;
    font-size: 13px;
}

.gv-am-separator::before,
.gv-am-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* ── Form fields ── */

.gv-am-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gv-am-field {
    position: relative;
    margin-bottom: 4px;
}

.gv-am-field input {
    width: 100% !important;
    max-width: none !important;
    height: 44px !important;
    line-height: normal !important;
    padding: 0 12px 0 36px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    font-family: inherit !important;
    font-size: 15px !important;
    color: #111 !important;
    background: #fff !important;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none !important;
    box-sizing: border-box !important;
}

.gv-am-password-field input {
    padding-right: 40px !important;
}

.gv-am-field input:focus {
    border-color: #C8542D;
    box-shadow: 0 0 0 3px rgba(200, 84, 45, 0.1);
}

.gv-am-field input::placeholder {
    color: #aaa;
}

.gv-am-field-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #999;
    pointer-events: none;
}

.gv-am-field-error {
    font-size: 13px;
    color: #dc2626;
    text-align: left;
    min-height: 18px;
    line-height: 18px;
    padding: 0 4px;
}

/* ── Password eye toggle ── */

.gv-am-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 0;
    border-radius: 4px;
    transition: color 0.15s;
}

.gv-am-eye:hover { color: #333; }

.gv-am-eye svg {
    width: 16px;
    height: 16px;
}

/* ── Forgot password ── */

.gv-am-forgot {
    text-align: right;
    margin-bottom: 8px;
}

.gv-am-forgot a {
    font-size: 13px;
    color: #999;
    text-decoration: none;
    transition: color 0.15s;
}

.gv-am-forgot a:hover {
    color: #C8542D;
}

/* ── Submit button ── */

.gv-am-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    background: #C8542D;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    padding: 0;
    margin-top: 8px;
}

.gv-am-submit:hover:not(:disabled) {
    background: #b44a27;
}

.gv-am-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.gv-am-spinner {
    width: 18px;
    height: 18px;
    animation: gv-am-spin 1s linear infinite;
    display: none;
}

.gv-am-spinner-track { opacity: 0.25; }
.gv-am-spinner-head { opacity: 0.75; }

.gv-am-submit--loading .gv-am-spinner { display: block; }

@keyframes gv-am-spin {
    to { transform: rotate(360deg); }
}

/* ── Toggle link ── */

.gv-am-toggle {
    margin-top: 12px;
}

.gv-am-toggle button {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 14px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s;
}

.gv-am-toggle button:hover { color: #333; }
.gv-am-toggle button span { font-weight: 600; color: #333; }

/* ── Legal text ── */

.gv-am-legal {
    margin-top: 20px;
    font-size: 12px;
    line-height: 1.6;
    color: #999;
}

.gv-am-legal a {
    color: #999;
    text-decoration: underline;
    transition: color 0.15s;
}

.gv-am-legal a:hover { color: #666; }

/* ── Responsive ── */

@media (max-width: 480px) {
    .gv-am-dialog {
        padding: 24px 20px;
        border-radius: 12px;
    }

    .gv-am-title {
        font-size: 20px;
    }

    .gv-am-icon {
        width: 56px;
        height: 56px;
    }

    .gv-am-heart,
    .gv-am-check {
        width: 28px;
        height: 28px;
    }
}
