/**
 * Authentication Button - IT-Wallet
 * Official component for authentication via IT-Wallet
 * Based on Bootstrap Italia
 * 
 * Brand Manual Specifications:
 * - Icon: IT-Wallet symbol (left side only)
 * - Font: Titillium Sans Pro (sizes according to design system)
 * - Variant: primary blue #0066CC only (no outline)
 * - Three positioning variants:
 *   1. Standard: icon and label left-aligned, size depends on label length
 *   2. Fixed centered: fixed size, icon and label centered
 *   3. Fixed justified: fixed size, icon left-aligned, label centered in remaining space
 * 
 * Official Colors:
 * - Primary: #0066CC (Blu Italia)
 * - Text: #FFFFFF (White)
 */

/* Font definitions - Local static fonts (default) */
/* Uncomment the @import below to use Google Fonts CDN instead of local fonts */
/* @import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@400;600;700&display=swap'); */

/* Local font files - implementation of the design-system font "Titillium Sans Pro"
 * via the open-source webfont files commonly distributed as "Titillium Web".
 */
@font-face {
  font-family: 'Titillium Sans Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/titillium-web-400.ttf') format('truetype');
}

@font-face {
  font-family: 'Titillium Sans Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/titillium-web-600.ttf') format('truetype');
}

@font-face {
  font-family: 'Titillium Sans Pro';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/titillium-web-700.ttf') format('truetype');
}

/* Reset and base */
.btn-itwallet-auth {
  display: inline-flex;
  align-items: center;
  gap: 8px; /* Bootstrap Italia icon button spacing */
  font-family: "Titillium Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 600; /* Semi-bold per il label principale */
  text-align: left;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 2px solid transparent;
  border-radius: 4px;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
  background-color: #0066CC;
  color: #FFFFFF;
  padding: 12px 24px; /* Bootstrap Italia / design system spec */
  /* Default size: Medium (M) - versione consigliata */
  font-size: 1rem;        /* 16px */
  line-height: 1.4;       /* ~22px */
  min-height: 48px; /* Accessibility: minimum touch area */
  justify-content: flex-start; /* Default: left alignment */
  box-shadow: none;
}

.btn-itwallet-auth:hover:not(:disabled) {
  background-color: #0052A3;
  color: #FFFFFF;
  text-decoration: none;
}

.btn-itwallet-auth:focus {
  outline: 2px solid #7B61FF;
  outline-offset: 2px;
  background-color: #0066CC;
  color: #FFFFFF;
}


.btn-itwallet-auth:active:not(:disabled) {
  background-color: #003D7A;
}

.btn-itwallet-auth:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #0066CC;
  color: #FFFFFF;
}

/* Icon - default size Medium (M) */
.btn-itwallet-auth .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 24px;
}

.btn-itwallet-auth .btn-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  display: block;
}

/* Text */
.btn-itwallet-auth .btn-text {
  white-space: nowrap;
}

/* Positioning variants */

/* 1. Standard: icon and label left-aligned, size depends on label (default) */
.btn-itwallet-auth.btn-standard {
  justify-content: flex-start;
  width: auto;
}

/* 2. Fixed centered: fixed size, icon and label centered */
.btn-itwallet-auth.btn-fixed-centered {
  justify-content: center;
  width: 280px; /* Standard fixed size, can be customized */
}

/* 3. Fixed justified: fixed size, icon left-aligned, label centered in remaining space */
.btn-itwallet-auth.btn-fixed-justified {
  justify-content: flex-start;
  width: 280px; /* Standard fixed size, can be customized */
}

.btn-itwallet-auth.btn-fixed-justified .btn-icon {
  flex-shrink: 0;
}

.btn-itwallet-auth.btn-fixed-justified .btn-text {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}

/* Sizes - default is Medium (M) */

/* Small */
.btn-itwallet-auth.btn-sm {
  padding: 12px 24px;
  font-size: 0.875rem;   /* 14px */
  line-height: 1.428;    /* ~20px */
  min-height: 40px;
  gap: 8px;
}

.btn-itwallet-auth.btn-sm .btn-icon {
  width: 13px;
  height: 16px;
}

/* Medium (default) - base .btn-itwallet-auth already uses these values */
.btn-itwallet-auth.btn-md {
  padding: 12px 24px;
  font-size: 1rem;       /* 16px */
  line-height: 1.4;      /* ~22px */
  min-height: 48px;
  gap: 8px;
}

.btn-itwallet-auth.btn-md .btn-icon {
  width: 20px;
  height: 24px;
}

/* Large */
.btn-itwallet-auth.btn-lg {
  padding: 18px 24px;
  font-size: 1.125rem;   /* 18px */
  line-height: 1.444;    /* ~26px */
  min-height: 60px;
  gap: 8px;
}

.btn-itwallet-auth.btn-lg .btn-icon {
  width: 20px;
  height: 24px;
}

/* Size variants above set gap: 8px. That gap sits only between the icon and
   the label, so it would make the left space larger than the right one.
   The label must be centered in the space from the icon to the right padding. */
.btn-itwallet-auth.btn-fixed-justified {
  gap: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .btn-itwallet-auth {
    width: 100%;
    max-width: 100%;
  }
  
  .btn-itwallet-auth.btn-lg {
    padding: 16px 24px;
    font-size: 1rem;
    min-height: 56px;
  }
}

/* Accessibility: visible focus for keyboard */
.btn-itwallet-auth:focus-visible {
  outline: 3px solid #7B61FF;
  outline-offset: 3px;
}

/* Support for reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .btn-itwallet-auth {
    transition: none;
  }
}

/* Styles for link (if used as <a>) */
a.btn-itwallet-auth {
  display: inline-flex;
  text-decoration: none;
}

a.btn-itwallet-auth:hover {
  text-decoration: none;
}

/* Print styles */
@media print {
  .btn-itwallet-auth {
    border: 1px solid #000000;
    background-color: transparent;
    color: #000000;
  }
  
  .btn-itwallet-auth .btn-icon {
    display: none;
  }
}
