* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f7f7f7;
    color: #222;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page {
    min-height: 100vh;
    padding: 2rem;
    box-sizing: border-box;
}

.page--center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.page__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page__header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo {
    height: 40px;
    width: auto;
    flex-shrink: 0;
}

.site-name {
    font-size: 32px;
    margin: 0;
    font-weight: normal;
    white-space: nowrap;
}

.page__header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.page__header h1 {
    font-size: 32px;
    margin: 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.grid--vertical {
    grid-template-columns: 1fr;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.card--wide {
    grid-column: 1 / -1;
}

.card--narrow {
    max-width: 420px;
    width: 100%;
    text-align: center;
    margin: 0 auto;
}

.card h2 {
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 10px;
}

.card p {
    margin-bottom: 15px;
}

.btn {
    padding: 14px 28px;
    background: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 18px;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.btn--primary {
    background: #000;
}

.btn--success {
    background: #000;
}

.btn:hover {
    opacity: 0.9;
}

.btn-google {
    display: inline-block;
    text-decoration: none;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-google:hover {
    opacity: 0.9;
}

.btn-google img {
    display: block;
    width: 200px;
    height: auto;
    max-width: 100%;
}

pre {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 12px;
    overflow-x: auto;
    border: 1px solid #ddd;
    color: #222;
}

.token-container {
    position: relative;
    margin-top: 10px;
}

.token-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

pre {
    word-break: break-all;
    word-wrap: break-word;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #222;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: #999;
}

.btn-icon:active {
    transform: scale(0.95);
}

.btn-icon svg {
    display: block;
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 1rem;
}

.form-grid label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.form-grid label span {
    min-width: 150px;
    flex-shrink: 0;
}

.form-grid input,
.form-grid select {
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white;
    color: #222;
    padding: 8px 12px;
    width: 120px;
    max-width: 120px;
    flex-shrink: 0;
    font-size: 14px;
}

.settings-groups-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 1rem;
}

.settings-group {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.settings-group:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-group__title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #222;
}

.muted {
    color: #666;
    font-size: 14px;
}

.nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav__link {
    color: #222;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background-color 0.2s;
    font-size: 14px;
}

.nav__link:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.nav__link--active {
    background-color: rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

/* Tablet styles */
@media (max-width: 1024px) {
    .page {
        padding: 1.5rem;
    }
    
    .settings-groups-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 800px) {
    .page {
        padding: 1rem;
    }
    
    .settings-groups-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .settings-group {
        margin-bottom: 0;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid #eee;
    }
    .settings-group:last-of-type {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .form-grid label {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .form-grid label span {
        min-width: auto;
        width: 100%;
    }
    
    .form-grid input,
    .form-grid select {
        width: 100%;
        max-width: 100%;
    }
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.plan-card {
    background: #f7f7f7;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
}

.plan-card:hover {
    border-color: #000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.plan-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
    color: #222;
}

.plan-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    min-height: 40px;
}

.plan-price {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #222;
}

.plan-card .btn {
    width: 100%;
}

.subscription-info {
    margin-top: 15px;
}

.subscription-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.subscription-status--paid {
    background: #d4edda;
    color: #155724;
}

.subscription-status--pending {
    background: #fff3cd;
    color: #856404;
}

.subscription-status--canceled {
    background: #f8d7da;
    color: #721c24;
}

.subscription-status--payment_failed {
    background: #f8d7da;
    color: #721c24;
}

/* Mobile styles */
@media (max-width: 700px) {
    .page {
        padding: 1rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .plans-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .page__header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1rem;
    }
    
    .page__header h1 {
        font-size: 24px;
    }
    
    .site-name {
        font-size: 24px;
    }
    
    .logo {
        height: 32px;
    }
    
    .page__header-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .nav {
        order: -1;
        width: 100%;
        justify-content: stretch;
        margin-bottom: 0;
        gap: 0.5rem;
    }
    
    .nav__link {
        font-size: 13px;
        padding: 8px 12px;
        text-align: center;
        flex: 1;
    }
    
    .page__header-right .muted {
        text-align: center;
        font-size: 13px;
        padding: 4px 0;
    }
    
    .page__header-right form {
        width: 100%;
    }
    
    .page__header-right .btn {
        width: 100%;
        padding: 12px;
    }
    
    .card {
        padding: 1rem;
    }
    
    .card h2 {
        font-size: 20px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 16px;
        width: 100%;
    }
    
    .btn-google img {
        width: 180px;
    }
    
    .token-container {
        margin-top: 0.75rem;
    }
    
    pre {
        padding: 10px;
        font-size: 12px;
        line-height: 1.5;
    }
    
    .token-actions {
        top: 6px;
        right: 6px;
        gap: 4px;
    }
    
    .btn-icon {
        width: 28px;
        height: 28px;
    }
    
    .btn-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .plan-card {
        padding: 1rem;
    }
    
    .plan-card h3 {
        font-size: 18px;
    }
    
    .plan-price {
        font-size: 20px;
    }
    
    .subscription-info {
        font-size: 14px;
    }
    
    .subscription-info p {
        margin-bottom: 0.75rem;
    }
    
    .subscription-status {
        font-size: 12px;
        padding: 3px 10px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .page {
        padding: 0.75rem;
    }
    
    .site-name {
        font-size: 20px;
    }
    
    .logo {
        height: 28px;
    }
    
    .card {
        padding: 0.75rem;
    }
    
    .card h2 {
        font-size: 18px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 15px;
    }
    
    .btn-google img {
        width: 160px;
    }
    
    .plan-card {
        padding: 0.75rem;
    }
    
    .plan-card h3 {
        font-size: 16px;
    }
    
    .plan-price {
        font-size: 18px;
    }
    
    .plan-description {
        font-size: 13px;
    }
    
    pre {
        padding: 8px;
        font-size: 11px;
    }
    
    .settings-group__title {
        font-size: 16px;
    }
    
    .form-grid {
        gap: 12px;
    }
    
    .form-grid label {
        font-size: 13px;
    }
    
    .form-grid input,
    .form-grid select {
        padding: 6px 10px;
        font-size: 13px;
    }
}

